xiaoming32236046
commited on
Commit
•
3cf3920
1
Parent(s):
3e58957
Update app.py
Browse files
app.py
CHANGED
@@ -2,8 +2,8 @@ import gradio as gr
|
|
2 |
import openai
|
3 |
import os
|
4 |
from openai import OpenAI
|
5 |
-
client = OpenAI(api_key="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")
|
6 |
-
|
7 |
# 设置OpenAI的API密钥
|
8 |
|
9 |
# 将用户的输入数据以正确的格式提交给模型
|
@@ -31,5 +31,5 @@ iface = gr.Interface(
|
|
31 |
outputs="text"
|
32 |
)
|
33 |
|
34 |
-
iface.launch()
|
35 |
#share=True,debug=True
|
|
|
2 |
import openai
|
3 |
import os
|
4 |
from openai import OpenAI
|
5 |
+
#client = OpenAI(api_key="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")
|
6 |
+
client = OpenAI(api_key=os.getenv("OPENAI_API_KEY"))
|
7 |
# 设置OpenAI的API密钥
|
8 |
|
9 |
# 将用户的输入数据以正确的格式提交给模型
|
|
|
31 |
outputs="text"
|
32 |
)
|
33 |
|
34 |
+
iface.launch(share=True,debug=True)
|
35 |
#share=True,debug=True
|