Tiny-lamina-conversation-1.0

29
1
by
Finisha-LLM
Language Model
OTHER
New
29 downloads
Early-stage
Edge AI:
Mobile
Laptop
Server
Unknown
Mobile
Laptop
Server
Quick Summary

AI model with specialized capabilities.

Code Examples

Load model directlytexttransformers
# Load model directly
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM

tokenizer = AutoTokenizer.from_pretrained("Clemylia/Tiny-Tesity-Testing")
model = AutoModelForSeq2SeqLM.from_pretrained("Clemylia/Tiny-Tesity-Testing")

# Generate text with sampling and temperature
input_text = "Qui es-tu ?"
input_ids = tokenizer(input_text, return_tensors="pt").input_ids

# Generate output with do_sample and temperature
# You can adjust temperature for more or less creative output
# A temperature of 1.0 means no change to sampling distribution, <1.0 makes it sharper, >1.0 makes it flatter
generated_ids = model.generate(
    input_ids,
    do_sample=True,
    temperature=0.7,
    max_new_tokens=50, # Limit the length of the generated output
    top_k=50, # Consider only the top 50 most likely next tokens
    top_p=0.95, # Consider tokens whose cumulative probability exceeds 0.95
    early_stopping=True, # Add early_stopping parameter
    num_beams=1, # Explicitly set num_beams to 1 for sampling
    num_return_sequences=1 # Explicitly set num_return_sequences to 1
)

generated_text = tokenizer.decode(generated_ids[0], skip_special_tokens=True)
print(f"Input: {input_text}")
print(f"Generated: {generated_text}")
text
conversation_history = []

print("Chat with Tiny-lamina! Type 'quit' or 'exit' to end the conversation.")

while True:
    user_input = input("You: ")

    if user_input.lower() in ["quit", "exit"]:
        print("Exiting chat. Goodbye!")
        break

    conversation_history.append({"role": "user", "content": user_input})

    # Generate model response
    input_ids = tokenizer(user_input, return_tensors="pt").input_ids
    generated_ids = model.generate(
        input_ids,
        do_sample=True,
        temperature=0.7,
        max_new_tokens=50,
        top_k=50,
        top_p=0.95,
        early_stopping=True,
        num_beams=1,
        num_return_sequences=1
    )
    model_response = tokenizer.decode(generated_ids[0], skip_special_tokens=True)

    print(f"Model: {model_response}")
    conversation_history.append({"role": "assistant", "content": model_response})

print("\nConversation history:")
for entry in conversation_history:
    print(f"{entry['role'].capitalize()}: {entry['content']}")

Deploy This Model

Production-ready deployment in minutes

Together.ai

Instant API access to this model

Fastest API

Production-ready inference API. Start free, scale to millions.

Try Free API

Replicate

One-click model deployment

Easiest Setup

Run models in the cloud with simple API. No DevOps required.

Deploy Now

Disclosure: We may earn a commission from these partners. This helps keep LLMYourWay free.