Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -21,21 +21,22 @@ model = XGLMModel.from_pretrained("facebook/xglm-564M")
|
|
21 |
inputs = tokenizer(prompt, return_tensors="pt")
|
22 |
outputs = model(**inputs) #, labels=inputs["input_ids"])
|
23 |
|
|
|
24 |
last_hidden_states = outputs.last_hidden_state
|
|
|
25 |
|
26 |
-
output = last_hidden_states[0][0]
|
27 |
|
28 |
# decoded = tokenizer.decode(output[0][0]) # [0][0]
|
29 |
# print(decoded)
|
30 |
|
31 |
# output = Seq2SeqModelOutput(output)
|
32 |
|
33 |
-
output = tokenizer.batch_decode(output, skip_special_tokens=True, clean_up_tokenization_spaces=False)[0]
|
34 |
-
|
35 |
with st.container():
|
36 |
st.write('\n\n')
|
37 |
st.write('LLM-LANAChat\n\n')
|
38 |
-
st.write(
|
39 |
|
40 |
print('\nsaida gerada.')
|
41 |
print('\n\n')
|
|
|
21 |
inputs = tokenizer(prompt, return_tensors="pt")
|
22 |
outputs = model(**inputs) #, labels=inputs["input_ids"])
|
23 |
|
24 |
+
|
25 |
last_hidden_states = outputs.last_hidden_state
|
26 |
+
logits = last_hidden_states.logits
|
27 |
|
28 |
+
# output = last_hidden_states[0][0]
|
29 |
|
30 |
# decoded = tokenizer.decode(output[0][0]) # [0][0]
|
31 |
# print(decoded)
|
32 |
|
33 |
# output = Seq2SeqModelOutput(output)
|
34 |
|
35 |
+
# output = tokenizer.batch_decode(output, skip_special_tokens=True, clean_up_tokenization_spaces=False)[0]
|
|
|
36 |
with st.container():
|
37 |
st.write('\n\n')
|
38 |
st.write('LLM-LANAChat\n\n')
|
39 |
+
st.write(logits)
|
40 |
|
41 |
print('\nsaida gerada.')
|
42 |
print('\n\n')
|