Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -12,13 +12,14 @@ import os
|
|
12 |
|
13 |
# ACCESS_TOKEN = os.getenv("HF_TOKEN")
|
14 |
|
15 |
-
_ = """
|
16 |
client = OpenAI(
|
17 |
base_url="https://api-inference.huggingface.co/v1/",
|
18 |
-
api_key=ACCESS_TOKEN,
|
|
|
19 |
)
|
20 |
# """
|
21 |
-
client = InferenceClient()
|
22 |
|
23 |
def respond(
|
24 |
message,
|
@@ -68,7 +69,7 @@ footer {
|
|
68 |
demo = gr.ChatInterface(
|
69 |
respond,
|
70 |
type='messages',
|
71 |
-
description='chatbox',
|
72 |
additional_inputs=[
|
73 |
gr.Textbox(value="", label="System message"),
|
74 |
# gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Max new tokens"),
|
@@ -90,9 +91,9 @@ demo = gr.ChatInterface(
|
|
90 |
# retry_btn="Retry", # unexpected keyword argument 'retry_btn'
|
91 |
# undo_btn="Undo",
|
92 |
# clear_btn="Clear",
|
93 |
-
stop_btn='Cancel',
|
94 |
# theme="allenai/gradio-theme",
|
95 |
# theme="Nymbo/Alyx_Theme",
|
96 |
)
|
97 |
if __name__ == "__main__":
|
98 |
-
demo.launch()
|
|
|
12 |
|
13 |
# ACCESS_TOKEN = os.getenv("HF_TOKEN")
|
14 |
|
15 |
+
# _ = """
|
16 |
client = OpenAI(
|
17 |
base_url="https://api-inference.huggingface.co/v1/",
|
18 |
+
# api_key=ACCESS_TOKEN,
|
19 |
+
api_key=os.getenv("HF_TOKEN", 'na')
|
20 |
)
|
21 |
# """
|
22 |
+
# client = InferenceClient()
|
23 |
|
24 |
def respond(
|
25 |
message,
|
|
|
69 |
demo = gr.ChatInterface(
|
70 |
respond,
|
71 |
type='messages',
|
72 |
+
# description='chatbox',
|
73 |
additional_inputs=[
|
74 |
gr.Textbox(value="", label="System message"),
|
75 |
# gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Max new tokens"),
|
|
|
91 |
# retry_btn="Retry", # unexpected keyword argument 'retry_btn'
|
92 |
# undo_btn="Undo",
|
93 |
# clear_btn="Clear",
|
94 |
+
# stop_btn='Cancel',
|
95 |
# theme="allenai/gradio-theme",
|
96 |
# theme="Nymbo/Alyx_Theme",
|
97 |
)
|
98 |
if __name__ == "__main__":
|
99 |
+
demo.launch(ssr=False)
|