Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -52,14 +52,14 @@ base_model_id = "stabilityai/stablelm-3b-4e1t"
|
|
52 |
model_directory = "Tonic/stablemed"
|
53 |
|
54 |
# Instantiate the Tokenizer
|
55 |
-
tokenizer = AutoTokenizer.from_pretrained("stabilityai/stablelm-3b-4e1t", trust_remote_code=True, padding_side="left")
|
56 |
# tokenizer = AutoTokenizer.from_pretrained("Tonic/stablemed", trust_remote_code=True, padding_side="left")
|
57 |
tokenizer.pad_token = tokenizer.eos_token
|
58 |
tokenizer.padding_side = 'left'
|
59 |
|
60 |
# Load the PEFT model
|
61 |
peft_config = PeftConfig.from_pretrained("Tonic/stablemed", token=hf_token)
|
62 |
-
peft_model = MistralForCausalLM.from_pretrained("stabilityai/stablelm-3b-4e1t", trust_remote_code=True)
|
63 |
peft_model = PeftModel.from_pretrained(peft_model, "Tonic/stablemed", token=hf_token)
|
64 |
|
65 |
class ChatBot:
|
|
|
52 |
model_directory = "Tonic/stablemed"
|
53 |
|
54 |
# Instantiate the Tokenizer
|
55 |
+
tokenizer = AutoTokenizer.from_pretrained("stabilityai/stablelm-3b-4e1t", token=hf_token, trust_remote_code=True, padding_side="left")
|
56 |
# tokenizer = AutoTokenizer.from_pretrained("Tonic/stablemed", trust_remote_code=True, padding_side="left")
|
57 |
tokenizer.pad_token = tokenizer.eos_token
|
58 |
tokenizer.padding_side = 'left'
|
59 |
|
60 |
# Load the PEFT model
|
61 |
peft_config = PeftConfig.from_pretrained("Tonic/stablemed", token=hf_token)
|
62 |
+
peft_model = MistralForCausalLM.from_pretrained("stabilityai/stablelm-3b-4e1t", token=hf_token, trust_remote_code=True)
|
63 |
peft_model = PeftModel.from_pretrained(peft_model, "Tonic/stablemed", token=hf_token)
|
64 |
|
65 |
class ChatBot:
|