Update app.py
Browse files
app.py
CHANGED
@@ -5,9 +5,9 @@ import gradio as gr
|
|
5 |
# Create a dictionary of models
|
6 |
MODELS = {
|
7 |
"FB": "facebook/xglm-1.7B",
|
8 |
-
"
|
9 |
"GPT2": "datificate/gpt2-small-spanish",
|
10 |
-
"OpenAssistant":"OpenAssistant/oasst-sft-
|
11 |
}
|
12 |
|
13 |
# Define your function
|
@@ -15,7 +15,7 @@ def generate_and_analyze(model_name, input_text):
|
|
15 |
# Load the model from the dictionary using the selected model name
|
16 |
model = MODELS[model_name]
|
17 |
text_generator = pipeline('text-generation', model=model)
|
18 |
-
result = text_generator(input_text, max_length=
|
19 |
return result['generated_text']
|
20 |
|
21 |
# Define your interface
|
|
|
5 |
# Create a dictionary of models
|
6 |
MODELS = {
|
7 |
"FB": "facebook/xglm-1.7B",
|
8 |
+
"GPT4All": "ParisNeo/GPT4All-Community-Discussions",
|
9 |
"GPT2": "datificate/gpt2-small-spanish",
|
10 |
+
"OpenAssistant":"OpenAssistant/oasst-sft-6-llama-30b-xor"
|
11 |
}
|
12 |
|
13 |
# Define your function
|
|
|
15 |
# Load the model from the dictionary using the selected model name
|
16 |
model = MODELS[model_name]
|
17 |
text_generator = pipeline('text-generation', model=model)
|
18 |
+
result = text_generator(input_text, max_length=250, do_sample=True)[0]
|
19 |
return result['generated_text']
|
20 |
|
21 |
# Define your interface
|