kookoobau commited on
Commit
eadb9fc
1 Parent(s): f092898
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -1,5 +1,5 @@
1
  import gradio as gr
2
- from langchain.llms import HuggingFacePipeline
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 = HuggingFacePipeline(
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,