Tonic commited on
Commit
054ea8d
1 Parent(s): 6c18f3e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -4
app.py CHANGED
@@ -51,7 +51,7 @@ device = "cuda" if torch.cuda.is_available() else "cpu"
51
 
52
  # Use the base model's ID
53
  base_model_id = "mistralai/Mistral-7B-v0.1"
54
- model_directory = "Tonic/mistralmed"
55
 
56
  # Instantiate the Tokenizer
57
  tokenizer = AutoTokenizer.from_pretrained("mistralai/Mistral-7B-v0.1", trust_remote_code=True, padding_side="left")
@@ -59,6 +59,12 @@ tokenizer = AutoTokenizer.from_pretrained("mistralai/Mistral-7B-v0.1", trust_rem
59
  tokenizer.pad_token = tokenizer.eos_token
60
  tokenizer.padding_side = 'left'
61
 
 
 
 
 
 
 
62
  # Specify the configuration class for the model
63
  #model_config = AutoConfig.from_pretrained(base_model_id)
64
 
@@ -66,9 +72,9 @@ tokenizer.padding_side = 'left'
66
  #peft_model = AutoModelForCausalLM.from_pretrained(base_model_id, config=model_config)
67
 
68
  # Load the PEFT model
69
- peft_config = PeftConfig.from_pretrained("Tonic/mistralmed", token="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")
70
- peft_model = MistralForCausalLM.from_pretrained("mistralai/Mistral-7B-v0.1", trust_remote_code=True)
71
- peft_model = PeftModel.from_pretrained(peft_model, "Tonic/mistralmed", token="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")
72
 
73
  class ChatBot:
74
  def __init__(self):
 
51
 
52
  # Use the base model's ID
53
  base_model_id = "mistralai/Mistral-7B-v0.1"
54
+ model_directory = "Tonic/GaiaMiniMed"
55
 
56
  # Instantiate the Tokenizer
57
  tokenizer = AutoTokenizer.from_pretrained("mistralai/Mistral-7B-v0.1", 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
+
64
+ peft_config = PeftConfig.from_pretrained("Tonic/GaiaMiniMed")
65
+ peft_model = AutoModelForCausalLM.from_pretrained("tiiuae/falcon-7b-instruct")
66
+ peft_model = PeftModel.from_pretrained(model, "Tonic/GaiaMiniMed")
67
+
68
  # Specify the configuration class for the model
69
  #model_config = AutoConfig.from_pretrained(base_model_id)
70
 
 
72
  #peft_model = AutoModelForCausalLM.from_pretrained(base_model_id, config=model_config)
73
 
74
  # Load the PEFT model
75
+ # peft_config = PeftConfig.from_pretrained("Tonic/mistralmed", token="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")
76
+ # peft_model = MistralForCausalLM.from_pretrained("mistralai/Mistral-7B-v0.1", trust_remote_code=True)
77
+ # peft_model = PeftModel.from_pretrained(peft_model, "Tonic/mistralmed", token="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")
78
 
79
  class ChatBot:
80
  def __init__(self):