mery22 commited on
Commit
0a90c55
1 Parent(s): d5e6fee

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -26,11 +26,11 @@ import transformers
26
  token=st.secrets["HF_TOKEN"]
27
  from huggingface_hub import login
28
  login(token=st.secrets["HF_TOKEN"])
29
- repo_id = "mistralai/Mistral-7B-Instruct-v0.3"
 
30
 
31
- model = HuggingFaceEndpoint(
32
- repo_id=repo_id, max_length=128, temperature=0.5, token=token
33
- )
34
 
35
  from langchain_community.document_loaders import TextLoader
36
  from langchain_text_splitters import CharacterTextSplitter
 
26
  token=st.secrets["HF_TOKEN"]
27
  from huggingface_hub import login
28
  login(token=st.secrets["HF_TOKEN"])
29
+ # Load model directly
30
+ from transformers import AutoTokenizer, AutoModelForCausalLM
31
 
32
+ tokenizer = AutoTokenizer.from_pretrained("mistralai/Mistral-7B-Instruct-v0.3")
33
+ model = AutoModelForCausalLM.from_pretrained("mistralai/Mistral-7B-Instruct-v0.3")
 
34
 
35
  from langchain_community.document_loaders import TextLoader
36
  from langchain_text_splitters import CharacterTextSplitter