T-K-O-H commited on
Commit
86d233c
·
1 Parent(s): 34a7b89

async stuff 5

Browse files
Files changed (2) hide show
  1. .dockerignore +0 -109
  2. app.py +8 -10
.dockerignore DELETED
@@ -1,109 +0,0 @@
1
- # Version control
2
- .git
3
- .gitignore
4
- .gitattributes
5
- .github/
6
- .gitlab/
7
-
8
- # Python
9
- __pycache__/
10
- *.py[cod]
11
- *$py.class
12
- *.so
13
- .Python
14
- env/
15
- build/
16
- develop-eggs/
17
- dist/
18
- downloads/
19
- eggs/
20
- .eggs/
21
- lib/
22
- lib64/
23
- parts/
24
- sdist/
25
- var/
26
- wheels/
27
- *.egg-info/
28
- .installed.cfg
29
- *.egg
30
- .pytest_cache/
31
- .coverage
32
- htmlcov/
33
- .tox/
34
- .nox/
35
- .hypothesis/
36
- .mypy_cache/
37
-
38
- # Virtual Environment
39
- venv/
40
- ENV/
41
- .env
42
- .venv/
43
- .venv2/
44
- .venv3/
45
- env/
46
- env.bak/
47
- venv.bak/
48
-
49
- # IDE
50
- .idea/
51
- .vscode/
52
- *.swp
53
- *.swo
54
- *.swn
55
- *~
56
- .DS_Store
57
- Thumbs.db
58
- *.sublime-project
59
- *.sublime-workspace
60
- .project
61
- .settings/
62
- .classpath
63
- *.code-workspace
64
-
65
- # Project specific
66
- chroma_db/
67
- *.log
68
- .env
69
- *.db
70
- *.sqlite
71
- *.sqlite3
72
- temp/
73
- tmp/
74
- logs/
75
- data/
76
- models/
77
- *.pkl
78
- *.h5
79
- *.model
80
- *.bin
81
- *.vec
82
- *.npy
83
- *.npz
84
- node_modules/
85
- synthetic_data.json
86
-
87
- # Docker
88
- .docker/
89
- docker-compose*.yml
90
- Dockerfile*
91
- .dockerignore
92
-
93
- # Documentation
94
- docs/
95
- *.md
96
- *.rst
97
- *.txt
98
- !requirements.txt
99
- LICENSE
100
- CHANGELOG*
101
-
102
- # Jupyter Notebooks
103
- .ipynb_checkpoints
104
- *.ipynb
105
-
106
- # Testing
107
- test/
108
- tests/
109
- testing/
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app.py CHANGED
@@ -25,14 +25,13 @@ from datasets import Dataset
25
  import plotly.graph_objects as go
26
  import numpy as np
27
  from langchain_community.vectorstores import FAISS
 
28
  from langchain_chroma import Chroma
29
  from langchain.schema import Document
30
  from datetime import datetime
31
  from langchain_community.embeddings import HuggingFaceEmbeddings
32
  from langchain.text_splitter import RecursiveCharacterTextSplitter
33
  from ragas import evaluate
34
- import nest_asyncio
35
- import asyncio
36
 
37
  # Load environment variables
38
  load_dotenv(verbose=True)
@@ -1681,13 +1680,12 @@ Important:
1681
  return state
1682
 
1683
  if __name__ == "__main__":
1684
- # Apply nest_asyncio first
1685
- nest_asyncio.apply()
1686
-
1687
- # Set up event loop policy
1688
- asyncio.set_event_loop_policy(asyncio.DefaultEventLoopPolicy())
1689
-
1690
- # Create and configure the demo
1691
  print_graph() # Print the graph visualization
1692
  demo = create_ui()
1693
- demo.queue().launch(server_port=7862)
 
 
 
 
 
 
 
25
  import plotly.graph_objects as go
26
  import numpy as np
27
  from langchain_community.vectorstores import FAISS
28
+ import asyncio
29
  from langchain_chroma import Chroma
30
  from langchain.schema import Document
31
  from datetime import datetime
32
  from langchain_community.embeddings import HuggingFaceEmbeddings
33
  from langchain.text_splitter import RecursiveCharacterTextSplitter
34
  from ragas import evaluate
 
 
35
 
36
  # Load environment variables
37
  load_dotenv(verbose=True)
 
1680
  return state
1681
 
1682
  if __name__ == "__main__":
 
 
 
 
 
 
 
1683
  print_graph() # Print the graph visualization
1684
  demo = create_ui()
1685
+ demo.launch(
1686
+ server_name="0.0.0.0",
1687
+ server_port=None, # Let Gradio find an available port
1688
+ show_error=True,
1689
+ share=True,
1690
+ show_api=False
1691
+ )