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']) |