to(cuda)
Browse files
lora.py
CHANGED
@@ -34,7 +34,7 @@ def add_ingredient(ingredient, quantity):
|
|
34 |
|
35 |
# Function to enable/disable add button
|
36 |
def validate_inputs(ingredient, quantity):
|
37 |
-
if ingredient and quantity > 0:
|
38 |
return gr.update(interactive=True)
|
39 |
return gr.update(interactive=False)
|
40 |
|
@@ -62,7 +62,7 @@ def submit_to_model():
|
|
62 |
tokenize=True,
|
63 |
add_generation_prompt=True, # Must add for generation
|
64 |
return_tensors="pt",
|
65 |
-
)
|
66 |
|
67 |
text_streamer = TextIteratorStreamer(tokenizer, skip_prompt=True)
|
68 |
|
|
|
34 |
|
35 |
# Function to enable/disable add button
|
36 |
def validate_inputs(ingredient, quantity):
|
37 |
+
if ingredient and int(quantity) > 0:
|
38 |
return gr.update(interactive=True)
|
39 |
return gr.update(interactive=False)
|
40 |
|
|
|
62 |
tokenize=True,
|
63 |
add_generation_prompt=True, # Must add for generation
|
64 |
return_tensors="pt",
|
65 |
+
).to("cuda")
|
66 |
|
67 |
text_streamer = TextIteratorStreamer(tokenizer, skip_prompt=True)
|
68 |
|