0

I am playing with Hugging Face Inference API and I am trying to convert a numbered list into a cohesive prose paragraph. I have tried multiple models but I am not able to get things working.

I have tried GPT-2, BLOOM and T5 models, but in each case I am failing to get the prose paragraph output that I am seeking.

GPT-2:

curl -X POST https://api-inference.huggingface.co/models/gpt2 -H "Authorization: Bearer hf_mykey" -H "Content-Type: application/json" -d '{"inputs": "Please rewrite the following numbered list into a cohesive prose paragraph: 1. Wake up early 2. Eat a healthy breakfast 3. Exercise regularly 4. Stay organized 5. Get enough sleep"}'

[{"generated_text":"Please rewrite the following numbered list into a cohesive prose paragraph: 1. Wake up early 2. Eat a healthy breakfast 3. Exercise regularly 4. Stay organized 5. Get enough sleep to last five hours 26 30. Shoot for the top of their list 27 30. Go to a movies and events 32 32. Plan to watch another movie 33 35. Get a good apartment and a positive attitude much like living on the street 37 37. Find stuff to write about, and then set it up using whatever tools you have available 20 40. Don't listen to opinions of outliers (even just average folk)\n) 20 40. Expect endings often but will always leave wits about"}]

BLOOM:

curl -X POST https://api-inference.huggingface.co/models/bigscience/bloom -H "Authorization: Bearer hf_mykey" -H "Content-Type: application/json" -d '{"inputs": "Please rewrite the following numbered list into a cohesive prose paragraph: 1. Wake up early 2. Eat a healthy breakfast 3. Exercise regularly 4. Stay organized 5. Get enough sleep"}'

[{"generated_text":"Please rewrite the following numbered list into a cohesive prose paragraph: 1. Wake up early 2. Eat a healthy breakfast 3. Exercise regularly 4. Stay organized 5. Get enough sleep 6. Take breaks 7. Take time to relax 8. Take time to socialize 9. Take"}]

T5:

curl -X POST https://api-inference.huggingface.co/models/t5-small -H "Authorization: Bearer hf_mykey" -H "Content-Type: application/json" -d '{"inputs": "Please rewrite the following numbered list into a cohesive prose paragraph: 1. Wake up early 2. Eat a healthy breakfast 3. Exercise regularly 4. Stay organized 5. Get enough sleep"}'

{"error":"Model google-t5/t5-small is currently loading","estimated_time":20.0}

Sandeep
  • 101
  • 1

0 Answers0