prithivMLmods commited on
Commit
57ba18c
·
verified ·
1 Parent(s): 3d124f2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +46 -30
app.py CHANGED
@@ -2,39 +2,55 @@ import gradio as gr
2
  import sambanova_gradio
3
 
4
  css = '''
5
- .gradio-container{max-width: 1000px !important}
6
- h1{text-align:center}
 
 
 
 
 
 
 
7
  footer {
8
- visibility: hidden
 
 
 
 
 
 
 
 
 
 
9
  }
10
  '''
11
 
12
- with gr.Blocks(css=css) as demo:
13
- with gr.Tab("1B"):
14
- gr.load("Meta-Llama-3.2-1B-Instruct",
15
- src=sambanova_gradio.registry,
16
- examples=["Explain quantum gravity to a 5-year old.", "How many R are there in the word Strawberry? Think step by step."])
17
-
18
- with gr.Tab("3B"):
19
- gr.load("Meta-Llama-3.2-3B-Instruct",
20
- src=sambanova_gradio.registry,
21
- examples=["Explain quantum gravity to a 5-year old.", "How many R are there in the word Strawberry? Think step by step."])
22
-
23
- with gr.Tab("8B"):
24
- gr.load("Meta-Llama-3.1-8B-Instruct",
25
- src=sambanova_gradio.registry,
26
- examples=["Explain quantum gravity to a 5-year old.", "How many R are there in the word Strawberry? Think step by step."])
27
-
28
- with gr.Tab("70B"):
29
- gr.load('Meta-Llama-3.1-70B-Instruct-8k',
30
- src=sambanova_gradio.registry,
31
- examples=["Explain quantum gravity to a 5-year old.", "How many R are there in the word Strawberry? Think step by step."])
32
-
33
- with gr.Tab("405B"):
34
- gr.load('Meta-Llama-3.1-405B-Instruct',
35
- src=sambanova_gradio.registry,
36
- examples=["Explain quantum gravity to a 5-year old.", "How many R are there in the word Strawberry? Think step by step."])
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()