gemma-inference / test_chat.py
Leon4gr45's picture
Upload gemma-inference space
c5c5d80 verified
raw
history blame contribute delete
389 Bytes
import requests
import json
url = "https://harvesthealth-gemma-inference.hf.space/v1/chat/completions"
payload = {
"model": "google/gemma-2b-it",
"messages": [
{"role": "user", "content": "Hello, how are you?"}
]
}
headers = {
"Content-Type": "application/json"
}
response = requests.post(url, headers=headers, data=json.dumps(payload))
print(response.json())