Quentin GALLOUÉDEC commited on
Commit
4afacff
1 Parent(s): 511b703
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -5,14 +5,14 @@ from transformers import pipeline
5
 
6
  # Get the list of models from the Hugging Face Hub
7
  api = HfApi()
8
- models = api.list_models(author="gia-project", filter=ModelFilter(tags="text-generation"))
9
  models_names = [model.modelId for model in models]
10
 
11
  # Dictionary to store loaded models and their pipelines
12
  model_pipelines = {}
13
 
14
  # Load a default model initially
15
- default_model_name = "gia-project/gia2-small-untrained"
16
 
17
 
18
  def generate_text(model_name, input_text):
@@ -42,11 +42,11 @@ def generate_text(model_name, input_text):
42
  iface = gr.Interface(
43
  fn=generate_text, # Function to be called on user input
44
  inputs=[
45
- Dropdown(models_names, label="Select Model", value="gia-project/gia2-small-untrained"), # Select model
46
  Textbox(lines=5, label="Input Text"), # Textbox for entering text
47
  ],
48
  outputs=Textbox(label="Generated Text"), # Textbox to display the generated text
49
- title="GIA Text Generation", # Title of the interface
50
  )
51
 
52
  # Launch the Gradio interface
 
5
 
6
  # Get the list of models from the Hugging Face Hub
7
  api = HfApi()
8
+ models = api.list_models(author="jat-project", filter=ModelFilter(tags="text-generation"))
9
  models_names = [model.modelId for model in models]
10
 
11
  # Dictionary to store loaded models and their pipelines
12
  model_pipelines = {}
13
 
14
  # Load a default model initially
15
+ default_model_name = "jat-project/jat-small"
16
 
17
 
18
  def generate_text(model_name, input_text):
 
42
  iface = gr.Interface(
43
  fn=generate_text, # Function to be called on user input
44
  inputs=[
45
+ Dropdown(models_names, label="Select Model", value=default_model_name), # Select model
46
  Textbox(lines=5, label="Input Text"), # Textbox for entering text
47
  ],
48
  outputs=Textbox(label="Generated Text"), # Textbox to display the generated text
49
+ title="JAT Text Generation", # Title of the interface
50
  )
51
 
52
  # Launch the Gradio interface