Spaces:
Runtime error
Runtime error
fix: html 설명 수정
Browse files
app.py
CHANGED
@@ -7,7 +7,7 @@ import requests
|
|
7 |
API_URL = "https://api.openai.com/v1/chat/completions" #os.getenv("API_URL") + "/generate_stream"
|
8 |
|
9 |
#Testing with my Open AI Key
|
10 |
-
#OPENAI_API_KEY = os.getenv("OPENAI_API_KEY")
|
11 |
|
12 |
def predict(inputs, top_p, temperature, openai_api_key, chat_counter, chatbot=[], history=[]): #repetition_penalty, top_k
|
13 |
|
@@ -61,7 +61,6 @@ def predict(inputs, top_p, temperature, openai_api_key, chat_counter, chatbot=[]
|
|
61 |
print(f"payload is - {payload}")
|
62 |
# make a POST request to the API endpoint using the requests.post method, passing in stream=True
|
63 |
response = requests.post(API_URL, headers=headers, json=payload, stream=True)
|
64 |
-
#response = requests.post(API_URL, headers=headers, json=payload, stream=True)
|
65 |
token_counter = 0
|
66 |
partial_words = ""
|
67 |
|
@@ -91,16 +90,9 @@ def predict(inputs, top_p, temperature, openai_api_key, chat_counter, chatbot=[]
|
|
91 |
def reset_textbox():
|
92 |
return gr.update(value='')
|
93 |
|
94 |
-
title = """<h1 align="center"
|
95 |
-
description = """
|
96 |
-
|
97 |
-
User: <utterance>
|
98 |
-
Assistant: <utterance>
|
99 |
-
User: <utterance>
|
100 |
-
Assistant: <utterance>
|
101 |
-
...
|
102 |
-
```
|
103 |
-
In this app, you can explore the outputs of a gpt-3.5-turbo LLM.
|
104 |
"""
|
105 |
|
106 |
with gr.Blocks(css = """#col_container {width: 700px; margin-left: auto; margin-right: auto;}
|
|
|
7 |
API_URL = "https://api.openai.com/v1/chat/completions" #os.getenv("API_URL") + "/generate_stream"
|
8 |
|
9 |
#Testing with my Open AI Key
|
10 |
+
#OPENAI_API_KEY = os.getenv("OPENAI_API_KEY")
|
11 |
|
12 |
def predict(inputs, top_p, temperature, openai_api_key, chat_counter, chatbot=[], history=[]): #repetition_penalty, top_k
|
13 |
|
|
|
61 |
print(f"payload is - {payload}")
|
62 |
# make a POST request to the API endpoint using the requests.post method, passing in stream=True
|
63 |
response = requests.post(API_URL, headers=headers, json=payload, stream=True)
|
|
|
64 |
token_counter = 0
|
65 |
partial_words = ""
|
66 |
|
|
|
90 |
def reset_textbox():
|
91 |
return gr.update(value='')
|
92 |
|
93 |
+
title = """<h1 align="center">🌞챗GPT test🌞</h1>"""
|
94 |
+
description = """gpt-3.5-turbo LLM
|
95 |
+
API 토큰에는 유료결제한 계정의 OpenAI API키를 넣으면 됩니다🌞
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
96 |
"""
|
97 |
|
98 |
with gr.Blocks(css = """#col_container {width: 700px; margin-left: auto; margin-right: auto;}
|