Spaces:
Running
Running
yuntian-deng
commited on
Commit
•
9ee185a
1
Parent(s):
834609d
Update app.py
Browse files
app.py
CHANGED
@@ -76,12 +76,15 @@ def predict(inputs, top_p, temperature, chat_counter, chatbot, history, request:
|
|
76 |
}
|
77 |
OPENAI_API_KEY = random.choice(OPENAI_API_KEYS)
|
78 |
print (OPENAI_API_KEY)
|
|
|
|
|
79 |
headers = {
|
80 |
"Content-Type": "application/json",
|
81 |
"Authorization": f"Bearer {OPENAI_API_KEY}",
|
82 |
-
"Headers": f"{
|
83 |
}
|
84 |
-
print (
|
|
|
85 |
|
86 |
# print(f"chat_counter - {chat_counter}")
|
87 |
if chat_counter != 0 :
|
|
|
76 |
}
|
77 |
OPENAI_API_KEY = random.choice(OPENAI_API_KEYS)
|
78 |
print (OPENAI_API_KEY)
|
79 |
+
print (type(request.headers.raw))
|
80 |
+
headers_dict = {key.decode('utf-8'): value.decode('utf-8') for key, value in request.headers.raw}
|
81 |
headers = {
|
82 |
"Content-Type": "application/json",
|
83 |
"Authorization": f"Bearer {OPENAI_API_KEY}",
|
84 |
+
"Headers": f"{headers_dict}"
|
85 |
}
|
86 |
+
print (headers_dict)
|
87 |
+
sys.exit(1)
|
88 |
|
89 |
# print(f"chat_counter - {chat_counter}")
|
90 |
if chat_counter != 0 :
|