Spaces:
Sleeping
Sleeping
File size: 760 Bytes
db46476 1bd646f db46476 e4b60c9 db46476 5854b6f db46476 e4b60c9 1879669 db46476 e4b60c9 db46476 e4b60c9 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
'''
import streamlit as st
from transformers import pipeline
pipe = pipeline('sentiment-analysis')
text = ('enter some text:')
if text:
out = pipe(text)
st.json(out)
'''
from transformers import pipeline
import torch
model_name = "abacusai/Smaug-72B-v0.1"
pipe = pipeline("text-generation")
# Prompting the user for input text
input_text = "Tell me about yourself"
# Generating text based on the input
# Adjust parameters like max_length according to your needs
generated_texts = pipe(input_text, max_length=50, num_return_sequences=1)
# Displaying the generated text
# Assuming we only want the first generated sequence for simplicity
print("Generated text:")
for generated_text in generated_texts:
print(generated_text['generated_text'])
|