Vertical.ai / backend /scripts /test_zephyr.py
Abhisingh-18's picture
Mirror of github.com/Abhisingh18/Vertical.ai
1f7ead8 verified
Raw
History Blame Contribute Delete
807 Bytes
import sys
import os
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..')))
from huggingface_hub import InferenceClient
from backend.app.config import config
def verify_zephyr():
print("Verifying Zephyr-7b-beta...")
model_id = "HuggingFaceH4/zephyr-7b-beta"
try:
client = InferenceClient(token=config.HUGGINGFACE_API_KEY)
res = client.chat_completion(
model=model_id,
messages=[{"role": "user", "content": "Hello! Explain quantum physics in one sentence."}],
max_tokens=50
)
print("Success with Zephyr!")
print(res.choices[0].message.content)
except Exception as e:
print(f"Failed with Zephyr: {e}")
if __name__ == "__main__":
verify_zephyr()