Spaces:
Running
Running
Lohia, Aditya
commited on
Commit
·
03542ad
1
Parent(s):
f6136a1
update: finalize changes
Browse files
app.py
CHANGED
@@ -6,10 +6,11 @@ from dialog import get_dialog_box
|
|
6 |
from gateway import check_server_health, request_generation
|
7 |
|
8 |
# CONSTANTS
|
9 |
-
MAX_NEW_TOKENS: int =
|
10 |
|
11 |
# GET ENVIRONMENT VARIABLES
|
12 |
-
CLOUD_GATEWAY_API = os.getenv("API_ENDPOINT")
|
|
|
13 |
|
14 |
|
15 |
def toggle_ui():
|
@@ -77,7 +78,11 @@ def generate(
|
|
77 |
chat_interface = gr.ChatInterface(
|
78 |
fn=generate,
|
79 |
additional_inputs=[
|
80 |
-
gr.Textbox(
|
|
|
|
|
|
|
|
|
81 |
gr.Slider(
|
82 |
label="Max New Tokens",
|
83 |
minimum=1,
|
@@ -116,8 +121,9 @@ chat_interface = gr.ChatInterface(
|
|
116 |
],
|
117 |
stop_btn=None,
|
118 |
examples=[
|
|
|
119 |
[
|
120 |
-
"
|
121 |
],
|
122 |
["Can you explain briefly to me what is the Python programming language?"],
|
123 |
["Explain the plot of Cinderella in a sentence."],
|
@@ -152,7 +158,8 @@ with gr.Blocks(css="style.css", fill_height=True) as demo:
|
|
152 |
|
153 |
|
154 |
if __name__ == "__main__":
|
155 |
-
demo.queue(
|
156 |
-
|
157 |
-
|
158 |
-
).launch()
|
|
|
|
6 |
from gateway import check_server_health, request_generation
|
7 |
|
8 |
# CONSTANTS
|
9 |
+
MAX_NEW_TOKENS: int = 2048
|
10 |
|
11 |
# GET ENVIRONMENT VARIABLES
|
12 |
+
# CLOUD_GATEWAY_API = os.getenv("API_ENDPOINT")
|
13 |
+
CLOUD_GATEWAY_API = "http://aac1.amd.com:7003"
|
14 |
|
15 |
|
16 |
def toggle_ui():
|
|
|
78 |
chat_interface = gr.ChatInterface(
|
79 |
fn=generate,
|
80 |
additional_inputs=[
|
81 |
+
gr.Textbox(
|
82 |
+
label="System prompt",
|
83 |
+
value="You are a highly capable AI assistant. Provide accurate, concise, and fact-based responses that are directly relevant to the user's query. Avoid speculation, ensure logical consistency, and maintain clarity in longer outputs. Keep answers well-structured and under 1200 tokens unless explicitly requested otherwise.",
|
84 |
+
lines=3,
|
85 |
+
),
|
86 |
gr.Slider(
|
87 |
label="Max New Tokens",
|
88 |
minimum=1,
|
|
|
121 |
],
|
122 |
stop_btn=None,
|
123 |
examples=[
|
124 |
+
["Plan a three-day trips to Washington DC for Spring Blossom."],
|
125 |
[
|
126 |
+
"Compose a joyful and short musical piece for kids to celebrate Spring sunshine and blossom."
|
127 |
],
|
128 |
["Can you explain briefly to me what is the Python programming language?"],
|
129 |
["Explain the plot of Cinderella in a sentence."],
|
|
|
158 |
|
159 |
|
160 |
if __name__ == "__main__":
|
161 |
+
# demo.queue(
|
162 |
+
# max_size=int(os.getenv("QUEUE")),
|
163 |
+
# default_concurrency_limit=int(os.getenv("CONCURRENCY_LIMIT")),
|
164 |
+
# ).launch()
|
165 |
+
demo.queue().launch()
|