Spaces:
Runtime error
Runtime error
yuvaranianandhan24
commited on
Commit
•
83a2e00
1
Parent(s):
3e8c833
Update app.py
Browse files
app.py
CHANGED
@@ -5,6 +5,7 @@ from dotenv import load_dotenv
|
|
5 |
from llama_index.embeddings.huggingface import HuggingFaceEmbedding
|
6 |
from llama_index.core import Settings
|
7 |
import os
|
|
|
8 |
import base64
|
9 |
|
10 |
# Load environment variables
|
@@ -12,8 +13,8 @@ load_dotenv()
|
|
12 |
|
13 |
# Configure the Llama index settings
|
14 |
Settings.llm = HuggingFaceInferenceAPI(
|
15 |
-
model_name="
|
16 |
-
tokenizer_name="
|
17 |
context_window=3900,
|
18 |
token=os.getenv("HF_TOKEN"),
|
19 |
max_new_tokens=1000,
|
|
|
5 |
from llama_index.embeddings.huggingface import HuggingFaceEmbedding
|
6 |
from llama_index.core import Settings
|
7 |
import os
|
8 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
9 |
import base64
|
10 |
|
11 |
# Load environment variables
|
|
|
13 |
|
14 |
# Configure the Llama index settings
|
15 |
Settings.llm = HuggingFaceInferenceAPI(
|
16 |
+
model_name= AutoModelForCausalLM.from_pretrained("meta-llama/Meta-Llama-3-8B-Instruct")
|
17 |
+
tokenizer_name = AutoTokenizer.from_pretrained("meta-llama/Meta-Llama-3-8B-Instruct")
|
18 |
context_window=3900,
|
19 |
token=os.getenv("HF_TOKEN"),
|
20 |
max_new_tokens=1000,
|