Spaces:
Runtime error
Runtime error
kumshing-wilson-huang
commited on
Commit
•
7446464
1
Parent(s):
618d572
OK
Browse files- .env +1 -0
- app.py +3 -3
- requirements.txt +1 -1
.env
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
OPENAI_API_KEY=sk-proj-KyHyIzEDLKe94DhrSq6LT3BlbkFJynj2NRPnnRwdDSV3XaZY
|
app.py
CHANGED
@@ -1,8 +1,8 @@
|
|
1 |
from openai import OpenAI
|
2 |
import gradio as gr
|
|
|
3 |
|
4 |
-
|
5 |
-
client = OpenAI(api_key=api_key)
|
6 |
|
7 |
|
8 |
def predict(message, history):
|
@@ -24,4 +24,4 @@ def predict(message, history):
|
|
24 |
yield partial_message
|
25 |
|
26 |
|
27 |
-
gr.ChatInterface(predict).launch()
|
|
|
1 |
from openai import OpenAI
|
2 |
import gradio as gr
|
3 |
+
import os
|
4 |
|
5 |
+
client = OpenAI(api_key=os.environ.get("OPENAI_API_KEY"))
|
|
|
6 |
|
7 |
|
8 |
def predict(message, history):
|
|
|
24 |
yield partial_message
|
25 |
|
26 |
|
27 |
+
gr.ChatInterface(predict).launch(share=True)
|
requirements.txt
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
gradio
|
2 |
transformers
|
3 |
torch
|
4 |
openai
|
|
|
1 |
+
gradio==4.29
|
2 |
transformers
|
3 |
torch
|
4 |
openai
|