vaishakgkumar commited on
Commit
12555c1
1 Parent(s): 989f6d4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -67,8 +67,8 @@ peft_model = PeftModel.from_pretrained(peft_model, "vaishakgkumar/stablemedv1",
67
  class ChatBot:
68
  def __init__(self):
69
  self.history = []
70
-
71
- def predict(self, user_input, system_prompt="You are an expert analyst and provide assessment:"):
72
  prompt = [{'role': 'user', 'content': user_input + "\n" + system_prompt + ":"}]
73
  inputs = tokenizer.apply_chat_template(
74
  prompt,
@@ -77,9 +77,9 @@ def predict(self, user_input, system_prompt="You are an expert analyst and provi
77
  )
78
 
79
  # Generate a response using the model
80
- tokens = peft_model.generate(
81
  inputs.to(model.device),
82
- max_new_tokens=512,
83
  temperature=0.8,
84
  do_sample=False
85
  )
@@ -93,6 +93,7 @@ def predict(self, user_input, system_prompt="You are an expert analyst and provi
93
 
94
  return response_text
95
 
 
96
  bot = ChatBot()
97
 
98
 
 
67
  class ChatBot:
68
  def __init__(self):
69
  self.history = []
70
+
71
+ def predict(self, user_input, system_prompt="You are an expert analyst and provide assessment:"):
72
  prompt = [{'role': 'user', 'content': user_input + "\n" + system_prompt + ":"}]
73
  inputs = tokenizer.apply_chat_template(
74
  prompt,
 
77
  )
78
 
79
  # Generate a response using the model
80
+ tokens = model.generate(
81
  inputs.to(model.device),
82
+ max_new_tokens=250,
83
  temperature=0.8,
84
  do_sample=False
85
  )
 
93
 
94
  return response_text
95
 
96
+
97
  bot = ChatBot()
98
 
99