Tricia Nieva commited on
Commit
8234400
·
1 Parent(s): 4b33c79

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -16
app.py CHANGED
@@ -11,26 +11,19 @@ import gradio as gr
11
  openai.organization = "org-orRhfBkKOfOuNACbjPyWKbUt"
12
  openai.api_key = "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"
13
 
14
- def predict(input,initial_prompt, history=[]):
15
 
16
  response = openai.Completion.create(
17
- model="davinci:ft-placeholder:ai-dhd-2022-12-07-10-09-37",
18
- prompt= initial_prompt + "\n" + str(s),
19
- temperature=0.09,
20
- max_tokens=608,
21
- top_p=1,
22
- frequency_penalty=0,
23
- presence_penalty=0
24
- )
25
-
26
- # tokenize the new input sentence
27
- response2 = response["choices"][0]["text"]
28
- history.append((input, response2))
29
-
30
- return history, history
31
 
32
 
33
  gr.Interface(fn=predict,
34
- inputs=["text","text",'state'],
35
 
36
  outputs=["chatbot",'state']).launch()
 
11
  openai.organization = "org-orRhfBkKOfOuNACbjPyWKbUt"
12
  openai.api_key = "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"
13
 
14
+ def predict(initial_prompt):
15
 
16
  response = openai.Completion.create(
17
+ model="davinci:ft-placeholder:ai-dhd-2022-12-07-10-09-37",
18
+ prompt= initial_prompt + "\n" + str(s),
19
+ temperature=0.09,
20
+ max_tokens=608,
21
+ top_p=1,
22
+ frequency_penalty=0,
23
+ presence_penalty=0)
 
 
 
 
 
 
 
24
 
25
 
26
  gr.Interface(fn=predict,
27
+ inputs=["text",'state'],
28
 
29
  outputs=["chatbot",'state']).launch()