sifujohn commited on
Commit
8ffc05e
1 Parent(s): 41fc4c5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -7,10 +7,12 @@ class GroupTherapyAgent:
7
  def __init__(self, client):
8
  self.client = client
9
  self.max_length = 64
10
-
11
  def get_response(self, user_question):
12
- response = self.client(text=user_question, max_length=self.max_length, num_beams=4)
13
- return response[0]['generated_text']
 
 
14
 
15
  class GroupTherapyApplication:
16
  def __init__(self, client):
 
7
  def __init__(self, client):
8
  self.client = client
9
  self.max_length = 64
10
+
11
  def get_response(self, user_question):
12
+ # Make an API call to the model and get the response
13
+ response = self.client(inputs=user_question, parameters={"max_length": self.max_length, "num_beams": 4}, options={"wait_for_model": True})
14
+ return response['generated_text']
15
+
16
 
17
  class GroupTherapyApplication:
18
  def __init__(self, client):