Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -5,6 +5,18 @@ import gradio as gr
|
|
5 |
import random
|
6 |
from textwrap import wrap
|
7 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
# Functions to Wrap the Prompt Correctly
|
9 |
def wrap_text(text, width=90):
|
10 |
lines = text.split('\n')
|
@@ -33,7 +45,7 @@ def multimodal_prompt(user_input, system_prompt="You are an expert medical analy
|
|
33 |
**model_inputs,
|
34 |
max_length=500,
|
35 |
use_cache=True,
|
36 |
-
early_stopping=
|
37 |
bos_token_id=model.config.bos_token_id,
|
38 |
eos_token_id=model.config.eos_token_id,
|
39 |
pad_token_id=model.config.eos_token_id,
|
|
|
5 |
import random
|
6 |
from textwrap import wrap
|
7 |
|
8 |
+
# Define the PeftConfig
|
9 |
+
peft_config = PeftConfig(
|
10 |
+
max_length=500,
|
11 |
+
use_cache=True,
|
12 |
+
early_stopping=False,
|
13 |
+
bos_token_id=model.config.bos_token_id,
|
14 |
+
eos_token_id=model.config.eos_token_id,
|
15 |
+
pad_token_id=model.config.eos_token_id,
|
16 |
+
temperature=0.4,
|
17 |
+
do_sample=True
|
18 |
+
)
|
19 |
+
|
20 |
# Functions to Wrap the Prompt Correctly
|
21 |
def wrap_text(text, width=90):
|
22 |
lines = text.split('\n')
|
|
|
45 |
**model_inputs,
|
46 |
max_length=500,
|
47 |
use_cache=True,
|
48 |
+
early_stopping=False,
|
49 |
bos_token_id=model.config.bos_token_id,
|
50 |
eos_token_id=model.config.eos_token_id,
|
51 |
pad_token_id=model.config.eos_token_id,
|