Spaces:
Sleeping
Sleeping
update
Browse files
app.py
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
import gradio as gr
|
2 |
-
from langchain.llms import
|
3 |
from transformers import AutoTokenizer
|
4 |
|
5 |
# Define the Hugging Face model and tokenizer
|
@@ -7,7 +7,7 @@ model_name = "microsoft/DialoGPT-medium"
|
|
7 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
8 |
|
9 |
# Define the LangChain chat agent
|
10 |
-
agent =
|
11 |
model_name=model_name,
|
12 |
task="text2text-generation",
|
13 |
tokenizer=tokenizer,
|
|
|
1 |
import gradio as gr
|
2 |
+
from langchain.llms import HuggingFaceHub
|
3 |
from transformers import AutoTokenizer
|
4 |
|
5 |
# Define the Hugging Face model and tokenizer
|
|
|
7 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
8 |
|
9 |
# Define the LangChain chat agent
|
10 |
+
agent = HuggingFaceHub(
|
11 |
model_name=model_name,
|
12 |
task="text2text-generation",
|
13 |
tokenizer=tokenizer,
|