arabic-RAG / backend /query_llm.py
derek-thomas's picture
derek-thomas HF staff
Add gradio app!
8b15eea
raw
history blame
426 Bytes
import requests
from os import getenv
API_URL = getenv('API_URL')
BEARER = getenv('BEARER')
headers = {
"Authorization": f"Bearer {BEARER}",
"Content-Type": "application/json"
}
def call_jais(payload):
response = requests.post(API_URL, headers=headers, json=payload)
return response.json()
def generate(prompt: str):
payload = {'inputs': '', 'prompt':prompt}
response = call_jais(payload)
return response