Spaces:
Running
Running
prithivMLmods
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -2,39 +2,55 @@ import gradio as gr
|
|
2 |
import sambanova_gradio
|
3 |
|
4 |
css = '''
|
5 |
-
.gradio-container{
|
6 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
footer {
|
8 |
-
visibility: hidden
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
}
|
10 |
'''
|
11 |
|
12 |
-
with gr.Blocks(css=css) as demo:
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
gr.Markdown("### Sambanova API Documentation : [Visit here](https://cloud.sambanova.ai/apis)")
|
39 |
|
40 |
demo.launch()
|
|
|
2 |
import sambanova_gradio
|
3 |
|
4 |
css = '''
|
5 |
+
.gradio-container {
|
6 |
+
max-width: 1200px !important;
|
7 |
+
margin: auto;
|
8 |
+
}
|
9 |
+
h1 {
|
10 |
+
text-align: center;
|
11 |
+
font-size: 2.5em;
|
12 |
+
margin-bottom: 20px;
|
13 |
+
}
|
14 |
footer {
|
15 |
+
visibility: hidden;
|
16 |
+
}
|
17 |
+
.tabs {
|
18 |
+
margin-top: 20px;
|
19 |
+
}
|
20 |
+
.tab-content {
|
21 |
+
min-height: 600px;
|
22 |
+
}
|
23 |
+
.chatbot {
|
24 |
+
height: 500px;
|
25 |
+
overflow-y: auto;
|
26 |
}
|
27 |
'''
|
28 |
|
29 |
+
with gr.Blocks(css=css, title="Enhanced Language Model Interface") as demo:
|
30 |
+
gr.Markdown("# Language Model Comparison")
|
31 |
+
|
32 |
+
with gr.Tabs(css_class="tabs") as tabs:
|
33 |
+
for model in ["1B", "3B", "8B", "70B", "405B"]:
|
34 |
+
with gr.Tab(f"{model}", css_class="tab-content"):
|
35 |
+
if model == "405B":
|
36 |
+
model_name = "Meta-Llama-3.1-405B-Instruct"
|
37 |
+
elif model == "70B":
|
38 |
+
model_name = "Meta-Llama-3.1-70B-Instruct-8k"
|
39 |
+
elif model == "8B":
|
40 |
+
model_name = "Meta-Llama-3.1-8B-Instruct"
|
41 |
+
else:
|
42 |
+
model_name = f"Meta-Llama-3.2-{model}-Instruct"
|
43 |
+
|
44 |
+
gr.load(
|
45 |
+
model_name,
|
46 |
+
src=sambanova_gradio.registry,
|
47 |
+
examples=[
|
48 |
+
"Explain quantum gravity to a 5-year old.",
|
49 |
+
"How many R are there in the word Strawberry? Think step by step."
|
50 |
+
],
|
51 |
+
height=600
|
52 |
+
)
|
53 |
+
|
54 |
+
gr.Markdown("### Sambanova API Documentation : [Visit here](https://cloud.sambanova.ai/apis)")
|
|
|
55 |
|
56 |
demo.launch()
|