stableai / utils /llm_utils.py
subhamb04's picture
Upload 21 files
01812ff verified
raw
history blame contribute delete
334 Bytes
import hashlib
from config import client
def call_model(prompt: str, model="llama-3.1-8b-instant") -> str:
response = client.responses.create(
model=model,
input=prompt
)
return response.output_text.strip()
def get_hash(text: str) -> str:
return hashlib.sha256(text.encode()).hexdigest()