Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -53,6 +53,9 @@ device = "cuda" if torch.cuda.is_available() else "cpu"
|
|
| 53 |
base_model_id = "tiiuae/falcon-7b-instruct"
|
| 54 |
model_directory = "Tonic/GaiaMiniMed"
|
| 55 |
|
|
|
|
|
|
|
|
|
|
| 56 |
# Instantiate the Tokenizer
|
| 57 |
tokenizer = AutoTokenizer.from_pretrained("tiiuae/falcon-7b-instruct", trust_remote_code=True, padding_side="left")
|
| 58 |
# tokenizer = AutoTokenizer.from_pretrained("Tonic/mistralmed", trust_remote_code=True, padding_side="left")
|
|
@@ -61,8 +64,11 @@ tokenizer.padding_side = 'left'
|
|
| 61 |
|
| 62 |
# Load the GaiaMiniMed model with the specified configuration
|
| 63 |
# Load the Peft model with a specific configuration
|
|
|
|
|
|
|
|
|
|
|
|
|
| 64 |
peft_model = PeftModel.from_pretrained("Tonic/GaiaMiniMed")
|
| 65 |
-
peft_model = AutoModelForCausalLM.from_pretrained("tiiuae/falcon-7b-instruct")
|
| 66 |
peft_model = PeftModel.from_pretrained(peft_model, "Tonic/GaiaMiniMed")
|
| 67 |
|
| 68 |
|
|
|
|
| 53 |
base_model_id = "tiiuae/falcon-7b-instruct"
|
| 54 |
model_directory = "Tonic/GaiaMiniMed"
|
| 55 |
|
| 56 |
+
|
| 57 |
+
|
| 58 |
+
|
| 59 |
# Instantiate the Tokenizer
|
| 60 |
tokenizer = AutoTokenizer.from_pretrained("tiiuae/falcon-7b-instruct", trust_remote_code=True, padding_side="left")
|
| 61 |
# tokenizer = AutoTokenizer.from_pretrained("Tonic/mistralmed", trust_remote_code=True, padding_side="left")
|
|
|
|
| 64 |
|
| 65 |
# Load the GaiaMiniMed model with the specified configuration
|
| 66 |
# Load the Peft model with a specific configuration
|
| 67 |
+
# Specify the configuration class for the model
|
| 68 |
+
model_config = AutoConfig.from_pretrained(base_model_id)
|
| 69 |
+
# Load the PEFT model with the specified configuration
|
| 70 |
+
peft_model = AutoModelForCausalLM.from_pretrained(base_model_id, config=model_config)
|
| 71 |
peft_model = PeftModel.from_pretrained("Tonic/GaiaMiniMed")
|
|
|
|
| 72 |
peft_model = PeftModel.from_pretrained(peft_model, "Tonic/GaiaMiniMed")
|
| 73 |
|
| 74 |
|