File size: 337 Bytes
683ab32
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
from transformers import pipeline

model_name = "appohfaiths/ghanabaai-model"
generator = pipeline("text-generation", model=model_name)

# Test it
question = "What is photosynthesis?"
result = generator(question, max_length=150, num_return_sequences=1, temperature=0.7, do_sample=True, truncation=True)
print(result[0]['generated_text'])