plAIn_voice / app.py
rdlf's picture
Update app.py
1bc78de verified
raw
history blame
1.06 kB
import streamlit as st
from PIL import Image
from groq import Groq
import os
st.image('endesa.jpeg', caption="", use_column_width=False)
st.image('calamo.png', caption="", use_column_width=False)
client = Groq(
api_key=os.environ.get("GROQ_API_KEY"),
)
# Rest of your Streamlit app
st.write("# Inicio")
# Other content of your app
st.title("plAIn")
# Add more components here
# Create a text input widget
user_input = st.text_input('Pega tu texto:', '')
# Define a function to process the input
def process_text(input_text):
prompt = "Eres un experto en lenguaje claro. Evalúa la calidad del lenguaje de este texto:"
input = prompt + text
chat_completion = client.chat.completions.create(
messages=[
{
"role": "user",
"content": input,
}
],
model="mixtral-8x7b-32768",
)
return (chat_completion.choices[0].message.content)
# Call the function with the user input
processed_output = process_text(user_input)
# Display the processed output
st.write('Texto procesado:', processed_output)