Views
No views yet
16pramodh/t2s_model)T5ForConditionalGeneration and supports text2text-generation via the Hugging Face Inference API.1curl -X POST \
2 -H "Authorization: Bearer YOUR_HF_TOKEN" \
3 -H "Content-Type: application/json" \
4 -d '{"inputs": "Get the names and emails of all customers who signed up after January 1, 2024 [SEP] CREATE TABLE customers (customer_id INT PRIMARY KEY, name VARCHAR(50), email VARCHAR(100), signup_date DATE);"}' \
5 https://api-inference.huggingface.co/models/16pramodh/t2s_modelfrom transformers import AutoTokenizer, AutoModelForSeq2SeqLM
model_name = "16pramodh/t2s_model"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSeq2SeqLM.from_pretrained(model_name)
input_text = "Get the names and emails of all customers who signed up after January 1, 2024 [SEP] CREATE TABLE customers (customer_id INT PRIMARY KEY, name VARCHAR(50), email VARCHAR(100), signup_date DATE);"
inputs = tokenizer(input_text, return_tensors="pt")
outputs = model.generate(**inputs)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))