Commit
·
2ee629b
1
Parent(s):
210400d
Convert input_ids to Long data type
Browse files
app.py
CHANGED
@@ -28,7 +28,6 @@ def text_enc(prompts, maxlen=None):
|
|
28 |
if maxlen is None: maxlen = tokenizer.model_max_length
|
29 |
inp = tokenizer(prompts, padding="max_length", max_length=maxlen, truncation=True, return_tensors="pt")
|
30 |
input_ids = inp.input_ids.long() # Convert input_ids to Long data type
|
31 |
-
input_ids = input_ids.float() # Convert input_ids to float32
|
32 |
return text_encoder(input_ids)[0]
|
33 |
|
34 |
def do_both(prompts):
|
|
|
28 |
if maxlen is None: maxlen = tokenizer.model_max_length
|
29 |
inp = tokenizer(prompts, padding="max_length", max_length=maxlen, truncation=True, return_tensors="pt")
|
30 |
input_ids = inp.input_ids.long() # Convert input_ids to Long data type
|
|
|
31 |
return text_encoder(input_ids)[0]
|
32 |
|
33 |
def do_both(prompts):
|