mery22 commited on
Commit
9b1d956
1 Parent(s): 5b837bc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -27,9 +27,11 @@ repo_id = "mistralai/Mistral-7B-Instruct-v0.3"
27
 
28
  from huggingface_hub import login
29
  login(token=st.secrets["HF_TOKEN"])
30
- llm = HuggingFaceEndpoint(
31
- repo_id=repo_id, max_length=128, temperature=0.5, token=st.secrets["HF_TOKEN"]
32
- )
 
 
33
 
34
  dataset= load_dataset("test-1.pdf")
35
  loader = PyPDFLoader(dataset)
 
27
 
28
  from huggingface_hub import login
29
  login(token=st.secrets["HF_TOKEN"])
30
+ # Load model directly
31
+ from transformers import AutoTokenizer, AutoModelForCausalLM
32
+
33
+ tokenizer = AutoTokenizer.from_pretrained("mistralai/Mistral-7B-Instruct-v0.3")
34
+ model = AutoModelForCausalLM.from_pretrained("mistralai/Mistral-7B-Instruct-v0.3")
35
 
36
  dataset= load_dataset("test-1.pdf")
37
  loader = PyPDFLoader(dataset)