dupuyta commited on
Commit
680c6f0
·
1 Parent(s): 24bf5fc

with langchain

Browse files
Files changed (1) hide show
  1. gradio_llm_example.py +8 -0
gradio_llm_example.py CHANGED
@@ -8,6 +8,14 @@ import pandas as pd
8
  # How to RUN code ==> gradio gradio_llm_example.py
9
 
10
 
 
 
 
 
 
 
 
 
11
  # Define text and title information
12
  title1 = "## 🤗 About QA App"
13
 
 
8
  # How to RUN code ==> gradio gradio_llm_example.py
9
 
10
 
11
+ from langchain import HuggingFacePipeline
12
+ def load_llm_model(model: str = "google/flan-t5-large") -> HuggingFacePipeline:
13
+ llm = HuggingFacePipeline.from_model_id(
14
+ model_id=model,
15
+ task="text2text-generation",
16
+ model_kwargs={"max_length": 1500, "load_in_8bit": True},
17
+ )
18
+
19
  # Define text and title information
20
  title1 = "## 🤗 About QA App"
21