zaeemzafar commited on
Commit
1ae2696
1 Parent(s): 9736f87

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -3,9 +3,12 @@ from transformers import AutoModelForCausalLM, AutoTokenizer
3
  import torch
4
 
5
  # Load the model and tokenizer
6
- model_name = "medgpt"
7
- tokenizer = AutoTokenizer.from_pretrained(model_name)
8
- model = AutoModelForCausalLM.from_pretrained(model_name)
 
 
 
9
 
10
  def respond_to_query(user_input):
11
  input_ids = tokenizer.encode(user_input + tokenizer.eos_token, return_tensors="pt")
 
3
  import torch
4
 
5
  # Load the model and tokenizer
6
+
7
+ # Load model directly
8
+ from transformers import AutoTokenizer, AutoModelForCausalLM
9
+
10
+ tokenizer = AutoTokenizer.from_pretrained("valeriojob/MedGPT-Llama3.1-8B-BA-v.1")
11
+ model = AutoModelForCausalLM.from_pretrained("valeriojob/MedGPT-Llama3.1-8B-BA-v.1")
12
 
13
  def respond_to_query(user_input):
14
  input_ids = tokenizer.encode(user_input + tokenizer.eos_token, return_tensors="pt")