Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -49,7 +49,7 @@ client = InferenceClient(
|
|
49 |
"mistralai/Mistral-7B-Instruct-v0.1"
|
50 |
)
|
51 |
|
52 |
-
def generate(image, temperature=0.9, max_new_tokens=
|
53 |
image_caption, gender, age, emotion = get_image_info(image)
|
54 |
|
55 |
#prompt = f"[INS] Generate a story based on person’s emotion: {emotion}, age: {age}, gender: {gender} of the image, and image’s caption: {image_caption}.[/INS]"
|
@@ -101,7 +101,7 @@ demo = gr.Interface(fn=generate,
|
|
101 |
|
102 |
gr.Slider(
|
103 |
label="Max new tokens",
|
104 |
-
value=
|
105 |
minimum=0,
|
106 |
maximum=3000,
|
107 |
step=1.0,
|
|
|
49 |
"mistralai/Mistral-7B-Instruct-v0.1"
|
50 |
)
|
51 |
|
52 |
+
def generate(image, temperature=0.9, max_new_tokens=3000, top_p=0.95, repetition_penalty=1.0):
|
53 |
image_caption, gender, age, emotion = get_image_info(image)
|
54 |
|
55 |
#prompt = f"[INS] Generate a story based on person’s emotion: {emotion}, age: {age}, gender: {gender} of the image, and image’s caption: {image_caption}.[/INS]"
|
|
|
101 |
|
102 |
gr.Slider(
|
103 |
label="Max new tokens",
|
104 |
+
value=3000,
|
105 |
minimum=0,
|
106 |
maximum=3000,
|
107 |
step=1.0,
|