Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -2,7 +2,12 @@ from llama_index import VectorStoreIndex,SimpleDirectoryReader,ServiceContext
|
|
| 2 |
from llama_index.llms import HuggingFaceLLM
|
| 3 |
from llama_index.prompts.prompts import SimpleInputPrompt
|
| 4 |
import os
|
|
|
|
| 5 |
from huggingface_hub import login
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
|
| 7 |
documents=SimpleDirectoryReader("/state-of-the-unioon.txt").load_data()
|
| 8 |
system_prompt="""
|
|
|
|
| 2 |
from llama_index.llms import HuggingFaceLLM
|
| 3 |
from llama_index.prompts.prompts import SimpleInputPrompt
|
| 4 |
import os
|
| 5 |
+
from dotenv import load_dotenv
|
| 6 |
from huggingface_hub import login
|
| 7 |
+
load_dotenv()
|
| 8 |
+
|
| 9 |
+
# Get the environment variables
|
| 10 |
+
HF_TOKEN = os.getenv('HUGGING_FACE_TOKEN')
|
| 11 |
|
| 12 |
documents=SimpleDirectoryReader("/state-of-the-unioon.txt").load_data()
|
| 13 |
system_prompt="""
|