Skip to content

Commit

Permalink
add user prompt
Browse files Browse the repository at this point in the history
Signed-off-by: Samhita Alla <[email protected]>
  • Loading branch information
samhita-alla committed Sep 10, 2024
1 parent 91ca863 commit 575b931
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions examples/ollama_plugin/ollama_plugin/serve_llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@
accelerator=A10G,
requests=Resources(gpu="0"),
)
def model_serving() -> str:
def model_serving(user_prompt: str) -> str:
client = OpenAI(base_url=f"{ollama_instance.base_url}/v1", api_key="ollama") # api key required but ignored

completion = client.chat.completions.create(
model="gemma2",
messages=[
{
"role": "user",
"content": "Write a limerick about the wonders of GPU computing.",
"content": user_prompt,
}
],
temperature=0.5,
Expand Down

0 comments on commit 575b931

Please sign in to comment.