Spaces:
Build error
Build error
Commit
·
0e92e7d
1
Parent(s):
e2007a5
check
Browse files
app.py
CHANGED
|
@@ -1,10 +1,13 @@
|
|
| 1 |
import gradio as gr
|
|
|
|
| 2 |
from huggingface_hub import InferenceClient
|
| 3 |
from langgraph.prebuilt import create_react_agent
|
| 4 |
from search_agent import tools
|
| 5 |
from langchain_huggingface import ChatHuggingFace, HuggingFaceEndpoint
|
| 6 |
from search_agent import tools
|
| 7 |
from langchain_core.messages import HumanMessage, AIMessage, SystemMessage
|
|
|
|
|
|
|
| 8 |
"""
|
| 9 |
For more information on `huggingface_hub` Inference API support, please check the docs: https://huggingface.co/docs/huggingface_hub/v0.22.2/en/guides/inference
|
| 10 |
"""
|
|
@@ -12,9 +15,7 @@ For more information on `huggingface_hub` Inference API support, please check th
|
|
| 12 |
llm = HuggingFaceEndpoint(
|
| 13 |
repo_id="meta-llama/Llama-3.2-1B-Instruct",
|
| 14 |
task="text-generation",
|
| 15 |
-
|
| 16 |
-
do_sample=False,
|
| 17 |
-
repetition_penalty=1.03,
|
| 18 |
)
|
| 19 |
|
| 20 |
chat_model = ChatHuggingFace(llm=llm)
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
+
import os
|
| 3 |
from huggingface_hub import InferenceClient
|
| 4 |
from langgraph.prebuilt import create_react_agent
|
| 5 |
from search_agent import tools
|
| 6 |
from langchain_huggingface import ChatHuggingFace, HuggingFaceEndpoint
|
| 7 |
from search_agent import tools
|
| 8 |
from langchain_core.messages import HumanMessage, AIMessage, SystemMessage
|
| 9 |
+
huggingfacehub_api_token = os.getenv('api-token')
|
| 10 |
+
|
| 11 |
"""
|
| 12 |
For more information on `huggingface_hub` Inference API support, please check the docs: https://huggingface.co/docs/huggingface_hub/v0.22.2/en/guides/inference
|
| 13 |
"""
|
|
|
|
| 15 |
llm = HuggingFaceEndpoint(
|
| 16 |
repo_id="meta-llama/Llama-3.2-1B-Instruct",
|
| 17 |
task="text-generation",
|
| 18 |
+
huggingfacehub_api_token=huggingfacehub_api_token,
|
|
|
|
|
|
|
| 19 |
)
|
| 20 |
|
| 21 |
chat_model = ChatHuggingFace(llm=llm)
|