BloodRain666 commited on
Commit
c092d4c
·
verified ·
1 Parent(s): ad13324

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -13,7 +13,7 @@ client = OpenAI(
13
  api_key=os.environ.get('YOUR_API_TOKEN')
14
  )
15
 
16
- def predict(message, history):
17
  history_openai_format = []
18
  for human, assistant in history:
19
  history_openai_format.append({"role": "user", "content": human })
@@ -23,7 +23,8 @@ def predict(message, history):
23
  response = client.chat.completions.create(model='google/gemma-1.1-7b-it',
24
  messages= history_openai_format,
25
  temperature=0.7,
26
- stream=True)
 
27
 
28
  partial_message = ""
29
  for chunk in response:
 
13
  api_key=os.environ.get('YOUR_API_TOKEN')
14
  )
15
 
16
+ def predict(message, history, test=""):
17
  history_openai_format = []
18
  for human, assistant in history:
19
  history_openai_format.append({"role": "user", "content": human })
 
23
  response = client.chat.completions.create(model='google/gemma-1.1-7b-it',
24
  messages= history_openai_format,
25
  temperature=0.7,
26
+ stream=True,
27
+ max_tokens=3000)
28
 
29
  partial_message = ""
30
  for chunk in response: