|
import streamlit as st |
|
from transformers import pipeline, AutoModelForCausalLM, AutoTokenizer |
|
|
|
|
|
model_name = "mistralai/Mistral-7B-Instruct-v0.2" |
|
model = AutoModelForCausalLM.from_pretrained(model_name) |
|
tokenizer = AutoTokenizer.from_pretrained(model_name) |
|
|
|
|
|
generator = pipeline('text-generation', model=model, tokenizer=tokenizer) |
|
|
|
|
|
st.title("Waifu Character Generator") |
|
|
|
|
|
name = st.text_input("Name of the Waifu") |
|
hair_color = st.selectbox("Hair Color", ["Blonde", "Brunette", "Red", "Black", "Blue", "Pink"]) |
|
personality = st.selectbox("Personality", ["Tsundere", "Yandere", "Kuudere", "Dandere", "Genki", "Normal"]) |
|
outfit_style = st.selectbox("Outfit Style", ["School Uniform", "Maid Outfit", "Casual", "Kimono", "Gothic Lolita"]) |
|
|
|
|
|
if st.button("Generate Waifu"): |
|
|
|
prompt = f"Create a waifu character named {name} with {hair_color} hair, a {personality} personality, and wearing a {outfit_style}." |
|
result = generator(prompt, max_length=150, num_return_sequences=1)[0]['generated_text'] |
|
|
|
|
|
st.subheader("Generated Waifu Character") |
|
st.write(result) |
|
|