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