Naman Pundir commited on
Commit
c9bb7a3
·
1 Parent(s): 9e9434e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -6
app.py CHANGED
@@ -3,13 +3,13 @@ from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
3
 
4
  # Define the models and their corresponding names
5
  models = {
6
- "Model 1 (facebook/bart-large-cnn)": {
7
- "model_name": "facebook/bart-large-cnn",
8
- "description": "Model 1",
9
  },
10
- "Model 2 (google/pegasus-multi_news)": {
11
- "model_name": "google/pegasus-multi_news",
12
- "description": "Model 2",
13
  },
14
  }
15
 
@@ -26,12 +26,20 @@ def summarize_text(input_text, selected_model):
26
  summary = tokenizer.decode(summary_ids[0], skip_special_tokens=True)
27
  return summary
28
 
 
 
 
 
 
 
 
29
  iface = gr.Interface(
30
  fn=summarize_text,
31
  inputs=[gr.inputs.Textbox(label="Input Text"), gr.inputs.Radio(list(models.keys()), label="Select Model")],
32
  outputs="text",
33
  title="Text Summarization App",
34
  description="Choose a model for text summarization and enter the text to summarize.",
 
35
  )
36
 
37
  if __name__ == "__main__":
 
3
 
4
  # Define the models and their corresponding names
5
  models = {
6
+ "Model 1 (lmsys/vicuna-13b-v1.3)": {
7
+ "model_name": "lmsys/vicuna-13b-v1.3",
8
+ "description": "Model 1: Foundation 13B Vicuna Model",
9
  },
10
+ "Model 2 (Aiyan99/theus_concepttagger)": {
11
+ "model_name": "Aiyan99/theus_concepttagger",
12
+ "description": "Model 2: My finetuned model",
13
  },
14
  }
15
 
 
26
  summary = tokenizer.decode(summary_ids[0], skip_special_tokens=True)
27
  return summary
28
 
29
+ # Define a custom theme for the Gradio interface
30
+ custom_theme = gr.theme(
31
+ page_title="MLE - Project (Tuning and Infra Project)1MLE - Project (Tuning and Infra Project)",
32
+ layout="wide",
33
+ page_bgcolor="black",
34
+ )
35
+
36
  iface = gr.Interface(
37
  fn=summarize_text,
38
  inputs=[gr.inputs.Textbox(label="Input Text"), gr.inputs.Radio(list(models.keys()), label="Select Model")],
39
  outputs="text",
40
  title="Text Summarization App",
41
  description="Choose a model for text summarization and enter the text to summarize.",
42
+ theme=custom_theme, # Apply the custom theme
43
  )
44
 
45
  if __name__ == "__main__":