Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,5 +1,4 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
-
from huggingface_hub import InferenceClient
|
| 3 |
from haystack.core.pipeline import Pipeline
|
| 4 |
from haystack.components.builders.answer_builder import AnswerBuilder
|
| 5 |
from haystack.components.converters.html import HTMLToDocument
|
|
@@ -13,10 +12,8 @@ from haystack.components.agents import Agent
|
|
| 13 |
from haystack.utils import Secret
|
| 14 |
from haystack.dataclasses import ChatMessage
|
| 15 |
|
| 16 |
-
""
|
| 17 |
-
|
| 18 |
-
"""
|
| 19 |
-
client = InferenceClient("HuggingFaceH4/zephyr-7b-beta")
|
| 20 |
|
| 21 |
|
| 22 |
class ChatbotAgent:
|
|
@@ -69,10 +66,8 @@ class ChatbotAgent:
|
|
| 69 |
# 🤖 Set up the Chat Generator
|
| 70 |
# ------------------------------
|
| 71 |
openai_generator = OpenAIChatGenerator(
|
| 72 |
-
api_base_url=
|
| 73 |
-
api_key=Secret.from_token(
|
| 74 |
-
"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"
|
| 75 |
-
),
|
| 76 |
model="meta/llama-3.3-70b-instruct",
|
| 77 |
)
|
| 78 |
|
|
|
|
| 1 |
import gradio as gr
|
|
|
|
| 2 |
from haystack.core.pipeline import Pipeline
|
| 3 |
from haystack.components.builders.answer_builder import AnswerBuilder
|
| 4 |
from haystack.components.converters.html import HTMLToDocument
|
|
|
|
| 12 |
from haystack.utils import Secret
|
| 13 |
from haystack.dataclasses import ChatMessage
|
| 14 |
|
| 15 |
+
base_url= os.getenv("BASE_URL")
|
| 16 |
+
api_key= os.getenv("API_KEY")
|
|
|
|
|
|
|
| 17 |
|
| 18 |
|
| 19 |
class ChatbotAgent:
|
|
|
|
| 66 |
# 🤖 Set up the Chat Generator
|
| 67 |
# ------------------------------
|
| 68 |
openai_generator = OpenAIChatGenerator(
|
| 69 |
+
api_base_url=base_url,
|
| 70 |
+
api_key=Secret.from_token(api_key),
|
|
|
|
|
|
|
| 71 |
model="meta/llama-3.3-70b-instruct",
|
| 72 |
)
|
| 73 |
|