Upload app.py
Browse files
app.py
CHANGED
@@ -12,15 +12,18 @@ API_URL = "https://ai.fakeopen.com/v1/chat/completions" # ็จๆท้่ฆๆไพ่ช
|
|
12 |
# ๆจๆญๅฝๆฐ
|
13 |
def predict(openai_gptapi_key, model, system_msg, inputs, top_p, temperature, max_tokens, presence_penalty, frequency_penalty, chat_counter, chatbot=[], history=[]):
|
14 |
|
15 |
-
print(f"
|
16 |
# ่ทๅๅฝๅไธญๅฝๆถ้ด
|
17 |
current_time = datetime.datetime.now(pytz.timezone('Asia/Shanghai')).strftime("%Yๅนด-%mๆ-%dๆฅ %Hๆถ:%Mๅ:%S็ง")
|
18 |
|
19 |
if inputs.strip() == '':
|
20 |
inputs = "ไฝ ๅฅฝๅ๏ผไฝฟ็จ่ฑ่ฏญไธไธญๆ็ฎๅไป็ปไธไฝ ่ชๅทฑๅง๏ผ"
|
|
|
|
|
|
|
21 |
if openai_gptapi_key.strip() == '':
|
22 |
openai_gptapi_key = "pk-this-is-a-real-free-pool-token-for-everyone"
|
23 |
-
print(f"[{current_time}] ่ๅคฉ๏ผAPIๅฏ้ฅ - Fake Open
|
24 |
else:
|
25 |
print(f"[{current_time}] ่ๅคฉ๏ผAPIๅฏ้ฅ - {openai_gptapi_key}")
|
26 |
|
@@ -29,8 +32,6 @@ def predict(openai_gptapi_key, model, system_msg, inputs, top_p, temperature, ma
|
|
29 |
"Authorization": f"Bearer {openai_gptapi_key}" # ็จๆทๅฐๆไพ่ชๅทฑ็ OPENAI_API_KEY
|
30 |
}
|
31 |
|
32 |
-
print(f"[{current_time}] ่ๅคฉ๏ผ็จๆทๆถๆฏ - {inputs}")
|
33 |
-
|
34 |
|
35 |
if system_msg.strip() == '':
|
36 |
initial_message = [{"role": "user", "content": f"{inputs}"},]
|
|
|
12 |
# ๆจๆญๅฝๆฐ
|
13 |
def predict(openai_gptapi_key, model, system_msg, inputs, top_p, temperature, max_tokens, presence_penalty, frequency_penalty, chat_counter, chatbot=[], history=[]):
|
14 |
|
15 |
+
print(f"โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ")
|
16 |
# ่ทๅๅฝๅไธญๅฝๆถ้ด
|
17 |
current_time = datetime.datetime.now(pytz.timezone('Asia/Shanghai')).strftime("%Yๅนด-%mๆ-%dๆฅ %Hๆถ:%Mๅ:%S็ง")
|
18 |
|
19 |
if inputs.strip() == '':
|
20 |
inputs = "ไฝ ๅฅฝๅ๏ผไฝฟ็จ่ฑ่ฏญไธไธญๆ็ฎๅไป็ปไธไฝ ่ชๅทฑๅง๏ผ"
|
21 |
+
|
22 |
+
print(f"[{current_time}] ่ๅคฉ๏ผ็จๆทๆถๆฏ - {inputs}")
|
23 |
+
|
24 |
if openai_gptapi_key.strip() == '':
|
25 |
openai_gptapi_key = "pk-this-is-a-real-free-pool-token-for-everyone"
|
26 |
+
print(f"[{current_time}] ่ๅคฉ๏ผAPIๅฏ้ฅ - ็ฑ Fake Open ๆๅกๆไพ")
|
27 |
else:
|
28 |
print(f"[{current_time}] ่ๅคฉ๏ผAPIๅฏ้ฅ - {openai_gptapi_key}")
|
29 |
|
|
|
32 |
"Authorization": f"Bearer {openai_gptapi_key}" # ็จๆทๅฐๆไพ่ชๅทฑ็ OPENAI_API_KEY
|
33 |
}
|
34 |
|
|
|
|
|
35 |
|
36 |
if system_msg.strip() == '':
|
37 |
initial_message = [{"role": "user", "content": f"{inputs}"},]
|