Update app.py
Browse files
app.py
CHANGED
|
@@ -4,12 +4,12 @@ import requests
|
|
| 4 |
import pandas as pd
|
| 5 |
from typing import Tuple, Optional
|
| 6 |
|
| 7 |
-
from retriever import
|
| 8 |
|
| 9 |
# Константы
|
| 10 |
DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
|
| 11 |
|
| 12 |
-
class
|
| 13 |
def __init__(self):
|
| 14 |
self.retriever_agent = RetrieverAgent()
|
| 15 |
|
|
@@ -28,7 +28,7 @@ def run_and_submit_all(profile: gr.OAuthProfile | None) -> Tuple[str, Optional[p
|
|
| 28 |
submit_url = f"{api_url}/submit"
|
| 29 |
|
| 30 |
try:
|
| 31 |
-
agent =
|
| 32 |
except Exception as e:
|
| 33 |
return f"❌ Error initializing agent: {str(e)}", None
|
| 34 |
|
|
@@ -89,7 +89,7 @@ def run_and_submit_all(profile: gr.OAuthProfile | None) -> Tuple[str, Optional[p
|
|
| 89 |
|
| 90 |
# Gradio Interface
|
| 91 |
with gr.Blocks() as demo:
|
| 92 |
-
gr.Markdown("#
|
| 93 |
gr.Markdown("""
|
| 94 |
**Instructions:**
|
| 95 |
1. Log in to Hugging Face below.
|
|
|
|
| 4 |
import pandas as pd
|
| 5 |
from typing import Tuple, Optional
|
| 6 |
|
| 7 |
+
from retriever import EnAgent as RetrieverAgent
|
| 8 |
|
| 9 |
# Константы
|
| 10 |
DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
|
| 11 |
|
| 12 |
+
class EnAgent:
|
| 13 |
def __init__(self):
|
| 14 |
self.retriever_agent = RetrieverAgent()
|
| 15 |
|
|
|
|
| 28 |
submit_url = f"{api_url}/submit"
|
| 29 |
|
| 30 |
try:
|
| 31 |
+
agent = EnAgent()
|
| 32 |
except Exception as e:
|
| 33 |
return f"❌ Error initializing agent: {str(e)}", None
|
| 34 |
|
|
|
|
| 89 |
|
| 90 |
# Gradio Interface
|
| 91 |
with gr.Blocks() as demo:
|
| 92 |
+
gr.Markdown("# En Agent")
|
| 93 |
gr.Markdown("""
|
| 94 |
**Instructions:**
|
| 95 |
1. Log in to Hugging Face below.
|