over 1 year ago
GPT4o: Code & Conquer Hackathon - Resources & Security Reminder
Hello Developers,
The GPT4o: Code & Conquer Hackathon is now officially live!
To get you started, here are your resources:
-
LLaMA Model (Meta-Llama/Llama-3.2-3B) hosted on Hugging Face: LLaMA Model Inference Link
Here’s a code snippet to quickly call the LLaMA model:
import requests
# API endpoint for the LLaMA model hosted on Hugging Face
API_URL = "https://l7sol6qs4x9pu9j7.us-east-1.aws.endpoints.huggingface.cloud"
headers = {
"Accept": "application/json",
"Content-Type": "application/json"
}
def query(payload):
"""
Sends a POST request to the LLaMA model API with the given payload.
Args:
payload (dict): The payload containing inputs and parameters for the model.
Returns:
dict: The JSON response from the API.
"""
response = requests.post(API_URL, headers=headers, json=payload)
return response.json()
# Sample payload to make a query
output = query({
"inputs": "Can you please let us know more details about your ",
"parameters": {
"top_p": 0.01,
"temperature": 0.7, # Adjust this value as needed for more creative or conservative responses
"max_new_tokens": 150,
"return_text": True,
"return_full_text": True,
"return_tensors": True,
"clean_up_tokenization_spaces": True,
"prefix": "#",
"handle_long_generation": "hole"
}
})
# Printing the output
print(output)
Feel free to use these resources or any other llm models of your choice to power your project.
Quick Reminders:
- Submission: Be sure to submit your projects on Devpost before the deadline.
- Guidance Available: Industry experts are available for mentorship via our Discord server: https://discord.gg/ETMYVf2BJd
Wishing you all the best in your hacking journey!
If you have any questions, I’m here to help.
Best regards,
Yash
