Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -21,7 +21,7 @@ class BasicAgent:
|
|
| 21 |
# Use free-tier compatible Qwen model via Inference API
|
| 22 |
self.client = InferenceClient(
|
| 23 |
model="Qwen/Qwen2-7B-Instruct",
|
| 24 |
-
token=os.
|
| 25 |
)
|
| 26 |
|
| 27 |
def __call__(self, question: str) -> str:
|
|
@@ -68,7 +68,7 @@ def run_and_submit_all( profile: gr.OAuthProfile | None):
|
|
| 68 |
|
| 69 |
# 1. Instantiate Agent ( modify this part to create your agent)
|
| 70 |
try:
|
| 71 |
-
|
| 72 |
agent = BasicAgent(hf_token=hf_token)
|
| 73 |
except Exception as e:
|
| 74 |
print(f"Error instantiating agent: {e}")
|
|
|
|
| 21 |
# Use free-tier compatible Qwen model via Inference API
|
| 22 |
self.client = InferenceClient(
|
| 23 |
model="Qwen/Qwen2-7B-Instruct",
|
| 24 |
+
token=os.getenv("HF_TOKEN") # Works without token
|
| 25 |
)
|
| 26 |
|
| 27 |
def __call__(self, question: str) -> str:
|
|
|
|
| 68 |
|
| 69 |
# 1. Instantiate Agent ( modify this part to create your agent)
|
| 70 |
try:
|
| 71 |
+
# Set this in Space settings
|
| 72 |
agent = BasicAgent(hf_token=hf_token)
|
| 73 |
except Exception as e:
|
| 74 |
print(f"Error instantiating agent: {e}")
|