Update app.py
Browse files
app.py
CHANGED
@@ -152,5 +152,22 @@ def create_ui():
|
|
152 |
return demo
|
153 |
|
154 |
if __name__ == "__main__":
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
155 |
demo = create_ui()
|
156 |
demo.launch(show_error=True)
|
|
|
152 |
return demo
|
153 |
|
154 |
if __name__ == "__main__":
|
155 |
+
# Initialize multiprocessing safely
|
156 |
+
freeze_support()
|
157 |
+
|
158 |
+
# Initialize agent
|
159 |
+
agent = TxAgent(
|
160 |
+
model_name,
|
161 |
+
rag_model_name,
|
162 |
+
tool_files_dict=new_tool_files,
|
163 |
+
force_finish=True,
|
164 |
+
enable_checker=True,
|
165 |
+
step_rag_num=10,
|
166 |
+
seed=100,
|
167 |
+
additional_default_tools=["DirectResponse", "RequireClarification"]
|
168 |
+
)
|
169 |
+
agent.init_model()
|
170 |
+
|
171 |
+
# Create and launch UI
|
172 |
demo = create_ui()
|
173 |
demo.launch(show_error=True)
|