Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,6 +1,8 @@
|
|
1 |
import torch
|
2 |
import gradio as gr
|
|
|
3 |
from pathlib import Path
|
|
|
4 |
from llama_index.core import VectorStoreIndex, SimpleDirectoryReader, Settings
|
5 |
from llama_index.core.memory import ChatMemoryBuffer
|
6 |
from llama_index.llms.huggingface import HuggingFaceLLM
|
@@ -37,6 +39,8 @@ Current conversation:
|
|
37 |
{query_str} [/INST]"""
|
38 |
)
|
39 |
|
|
|
|
|
40 |
llm = HuggingFaceLLM(
|
41 |
tokenizer_name="meta-llama/Llama-2-7b-chat-hf",
|
42 |
model_name="meta-llama/Llama-2-7b-chat-hf",
|
|
|
1 |
import torch
|
2 |
import gradio as gr
|
3 |
+
import os
|
4 |
from pathlib import Path
|
5 |
+
from huggingface_hub import login
|
6 |
from llama_index.core import VectorStoreIndex, SimpleDirectoryReader, Settings
|
7 |
from llama_index.core.memory import ChatMemoryBuffer
|
8 |
from llama_index.llms.huggingface import HuggingFaceLLM
|
|
|
39 |
{query_str} [/INST]"""
|
40 |
)
|
41 |
|
42 |
+
login(token=os.environ["HF_TOKEN"])
|
43 |
+
|
44 |
llm = HuggingFaceLLM(
|
45 |
tokenizer_name="meta-llama/Llama-2-7b-chat-hf",
|
46 |
model_name="meta-llama/Llama-2-7b-chat-hf",
|