Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -16,6 +16,18 @@ DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
|
|
| 16 |
|
| 17 |
# --- Basic Agent Definition ---
|
| 18 |
# ----- THIS IS WERE YOU CAN BUILD WHAT YOU WANT ------
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
|
| 20 |
class WikipediaSearchTool(Tool):
|
| 21 |
name = "wikipedia_search"
|
|
|
|
| 16 |
|
| 17 |
# --- Basic Agent Definition ---
|
| 18 |
# ----- THIS IS WERE YOU CAN BUILD WHAT YOU WANT ------
|
| 19 |
+
#test hugging face hub
|
| 20 |
+
from huggingface_hub import InferenceClient
|
| 21 |
+
import os
|
| 22 |
+
|
| 23 |
+
client = InferenceClient(model="meta-llama/Llama-2-7b-chat-hf", token=os.getenv("test"))
|
| 24 |
+
|
| 25 |
+
try:
|
| 26 |
+
response = client.text_generation("Hello, how are you?", max_new_tokens=50)
|
| 27 |
+
print("✅ Model response:", response)
|
| 28 |
+
except Exception as e:
|
| 29 |
+
print("❌ Direct call error:", e)
|
| 30 |
+
|
| 31 |
|
| 32 |
class WikipediaSearchTool(Tool):
|
| 33 |
name = "wikipedia_search"
|