Update app.py
Browse files
app.py
CHANGED
@@ -4,9 +4,9 @@ import logging
|
|
4 |
import torch
|
5 |
import gradio as gr
|
6 |
from tooluniverse import ToolUniverse
|
|
|
7 |
import warnings
|
8 |
from typing import List, Dict, Any
|
9 |
-
from txagent import TxAgent
|
10 |
|
11 |
# Suppress specific warnings
|
12 |
warnings.filterwarnings("ignore", category=UserWarning)
|
@@ -66,7 +66,7 @@ def patch_embedding_loading():
|
|
66 |
self.tool_desc_embedding = safe_load_embeddings(CONFIG["embedding_filename"])
|
67 |
|
68 |
# Handle tool count mismatch
|
69 |
-
tools = tooluniverse.get_all_tools()
|
70 |
current_count = len(tools)
|
71 |
embedding_count = len(self.tool_desc_embedding)
|
72 |
|
@@ -163,7 +163,7 @@ class TxAgentApp:
|
|
163 |
history=tx_history,
|
164 |
temperature=0.3,
|
165 |
max_new_tokens=1024,
|
166 |
-
max_token=8192,
|
167 |
call_agent=False,
|
168 |
conversation=None,
|
169 |
max_round=30
|
@@ -198,8 +198,7 @@ def create_interface() -> gr.Blocks:
|
|
198 |
|
199 |
chatbot = gr.Chatbot(
|
200 |
height=500,
|
201 |
-
label="Conversation"
|
202 |
-
bubble_full_width=False
|
203 |
)
|
204 |
msg = gr.Textbox(label="Your clinical question")
|
205 |
clear_btn = gr.Button("Clear Chat")
|
|
|
4 |
import torch
|
5 |
import gradio as gr
|
6 |
from tooluniverse import ToolUniverse
|
7 |
+
from txagent import TxAgent # Updated import statement
|
8 |
import warnings
|
9 |
from typing import List, Dict, Any
|
|
|
10 |
|
11 |
# Suppress specific warnings
|
12 |
warnings.filterwarnings("ignore", category=UserWarning)
|
|
|
66 |
self.tool_desc_embedding = safe_load_embeddings(CONFIG["embedding_filename"])
|
67 |
|
68 |
# Handle tool count mismatch
|
69 |
+
tools = tooluniverse.get_all_tools()
|
70 |
current_count = len(tools)
|
71 |
embedding_count = len(self.tool_desc_embedding)
|
72 |
|
|
|
163 |
history=tx_history,
|
164 |
temperature=0.3,
|
165 |
max_new_tokens=1024,
|
166 |
+
max_token=8192,
|
167 |
call_agent=False,
|
168 |
conversation=None,
|
169 |
max_round=30
|
|
|
198 |
|
199 |
chatbot = gr.Chatbot(
|
200 |
height=500,
|
201 |
+
label="Conversation"
|
|
|
202 |
)
|
203 |
msg = gr.Textbox(label="Your clinical question")
|
204 |
clear_btn = gr.Button("Clear Chat")
|