Spaces:
Sleeping
Sleeping
Update Qbot.py
Browse files
Qbot.py
CHANGED
|
@@ -5,6 +5,7 @@ from langchain_community.vectorstores import Chroma
|
|
| 5 |
from langchain_community.document_loaders import PyPDFLoader
|
| 6 |
from langchain.chains import RetrievalQA
|
| 7 |
import gradio as gr
|
|
|
|
| 8 |
|
| 9 |
#ignoring Unnecessary warnings
|
| 10 |
def warn(*arg, **kwargs):
|
|
@@ -17,7 +18,7 @@ warnings.filterwarnings("ignore")
|
|
| 17 |
|
| 18 |
def get_llm(model_id, temperature, max_new_tokens):
|
| 19 |
|
| 20 |
-
huggingface_api_key = ""
|
| 21 |
|
| 22 |
#initialize the pipeline
|
| 23 |
Qbot_llm = HuggingFaceHub(
|
|
|
|
| 5 |
from langchain_community.document_loaders import PyPDFLoader
|
| 6 |
from langchain.chains import RetrievalQA
|
| 7 |
import gradio as gr
|
| 8 |
+
import os
|
| 9 |
|
| 10 |
#ignoring Unnecessary warnings
|
| 11 |
def warn(*arg, **kwargs):
|
|
|
|
| 18 |
|
| 19 |
def get_llm(model_id, temperature, max_new_tokens):
|
| 20 |
|
| 21 |
+
huggingface_api_key = os.getenv("HUGGINGFACEHUB_API_TOKEN")
|
| 22 |
|
| 23 |
#initialize the pipeline
|
| 24 |
Qbot_llm = HuggingFaceHub(
|