Spaces:
Runtime error
Runtime error
hrishikeshagi
commited on
Commit
·
30bc44e
1
Parent(s):
abf144a
Update requirements.txt
Browse files- requirements.txt +3 -27
requirements.txt
CHANGED
@@ -1,27 +1,3 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
|
4 |
-
#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
|
5 |
-
|
6 |
-
openai.api_key = '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'
|
7 |
-
|
8 |
-
def openai_chat(prompt):
|
9 |
-
completions = openai.Completion.create(
|
10 |
-
engine="text-davinci-003",
|
11 |
-
prompt=prompt,
|
12 |
-
max_tokens=2048,
|
13 |
-
n=1,
|
14 |
-
temperature=0.5,
|
15 |
-
)
|
16 |
-
|
17 |
-
message = completions.choices[0].text
|
18 |
-
return message.strip()
|
19 |
-
|
20 |
-
def chatbot(input, history=[]):
|
21 |
-
output = openai_chat(input)
|
22 |
-
history.append((input, output))
|
23 |
-
return history, history
|
24 |
-
|
25 |
-
gr.Interface( title = 'An Alternative to chatGPT - Built by Hrishikesh', fn = chatbot,
|
26 |
-
inputs = ["text",'state'],
|
27 |
-
outputs = ["chatbot",'state']).launch(debug = True )
|
|
|
1 |
+
torch
|
2 |
+
transformers
|
3 |
+
openai
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|