test.py 517 B

123456789101112131415
  1. from aphrodite import LLM, SamplingParams
  2. prompts = [
  3. "What is a man? A",
  4. "The sun is a wondrous body, like a magnificent",
  5. "All flesh is grass and all the comeliness thereof",
  6. ]
  7. sampling_params = SamplingParams(temperature=0.8, top_p=0.95)
  8. llm = LLM(model="/home/alpindale/AI-Stuff/models/Pythia-70M")
  9. outputs = llm.generate(prompts, sampling_params)
  10. for output in outputs:
  11. prompt = output.prompt
  12. generated_text = output.outputs[0].text
  13. print(f"Prompt: {prompt!r}, Generated text: {generated_text!r}")