Update app.py
Browse files
app.py
CHANGED
|
@@ -3,6 +3,7 @@ import gradio as gr
|
|
| 3 |
import requests
|
| 4 |
import inspect
|
| 5 |
import pandas as pd
|
|
|
|
| 6 |
|
| 7 |
# (Keep Constants as is)
|
| 8 |
# --- Constants ---
|
|
@@ -87,7 +88,11 @@ def run_and_submit_all( profile: gr.OAuthProfile | None):
|
|
| 87 |
|
| 88 |
# 1. Instantiate Agent ( modify this part to create your agent)
|
| 89 |
try:
|
| 90 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 91 |
except Exception as e:
|
| 92 |
print(f"Error instantiating agent: {e}")
|
| 93 |
return f"Error initializing agent: {e}", None
|
|
|
|
| 3 |
import requests
|
| 4 |
import inspect
|
| 5 |
import pandas as pd
|
| 6 |
+
from langchain_community.llms import HuggingFaceHub
|
| 7 |
|
| 8 |
# (Keep Constants as is)
|
| 9 |
# --- Constants ---
|
|
|
|
| 88 |
|
| 89 |
# 1. Instantiate Agent ( modify this part to create your agent)
|
| 90 |
try:
|
| 91 |
+
llm = HuggingFaceHub(
|
| 92 |
+
repo_id="google/flan-t5-xl",
|
| 93 |
+
model_kwargs={"temperature": 0.5, "max_length": 512}
|
| 94 |
+
)
|
| 95 |
+
agent = BasicAgent(llm)
|
| 96 |
except Exception as e:
|
| 97 |
print(f"Error instantiating agent: {e}")
|
| 98 |
return f"Error initializing agent: {e}", None
|