yonikremer
commited on
Commit
•
70130da
1
Parent(s):
da1451c
deleted repeated input checks
Browse files- hanlde_form_submit.py +0 -6
hanlde_form_submit.py
CHANGED
@@ -68,14 +68,8 @@ def on_form_submit(model_name: str, output_length: int, prompt: str) -> str:
|
|
68 |
raise ValueError(f"The selected model {model_name} is not supported."
|
69 |
f"Supported models are all the models in:"
|
70 |
f" https://huggingface.co/models?pipeline_tag=text-generation&library=pytorch")
|
71 |
-
if output_length <= 0:
|
72 |
-
raise ValueError(f"The output length {output_length} must be > 0.")
|
73 |
if len(prompt) == 0:
|
74 |
raise ValueError(f"The prompt must not be empty.")
|
75 |
-
if not isinstance(prompt, str):
|
76 |
-
raise ValueError(f"The prompt must be a string.")
|
77 |
-
if not isinstance(output_length, int):
|
78 |
-
raise ValueError(f"The output length must be an integer.")
|
79 |
st.write(f"Loading model: {model_name}...")
|
80 |
loading_start_time = time()
|
81 |
pipeline = create_pipeline(
|
|
|
68 |
raise ValueError(f"The selected model {model_name} is not supported."
|
69 |
f"Supported models are all the models in:"
|
70 |
f" https://huggingface.co/models?pipeline_tag=text-generation&library=pytorch")
|
|
|
|
|
71 |
if len(prompt) == 0:
|
72 |
raise ValueError(f"The prompt must not be empty.")
|
|
|
|
|
|
|
|
|
73 |
st.write(f"Loading model: {model_name}...")
|
74 |
loading_start_time = time()
|
75 |
pipeline = create_pipeline(
|