lucataco/wizardcoder-python-34b-v1.0 🔢📝 → 📝

▶️ 881 runs 📅 Aug 2023 ⚙️ Cog 0.8.6 🔗 GitHub 📄 Paper ⚖️ License
code-generation python text-generation

About

Empowering Code Large Language Models with Evol-Instruct

Example Output

Prompt:

"write python code for a simple calculator"

Output

Here's a basic Python code for a simple calculator with addition, subtraction, multiplication and division operations:

num1 = float(input("Enter first number: "))
num2 = float(input("Enter second number: "))

print("Select operation")
print("1. Addition")
print("2. Subtraction")
print("3. Multiplication")
print("4. Division")

choice = input("Enter choice (1/2/3/4): ")

if choice == '1':
    print("Result: ", num1 + num2)
elif choice == '2':
    print("Result: ", num1 - num2)
elif choice == '3':
    print("Result: ", num1 * num2)
elif choice == '4':
    if num2 != 0:
        print("Result: ", num1 / num2)
else:
    print("Invalid input!")

In this program, we take two numbers as inputs from the user using float() function to convert them into floating point numbers. Then, we display a menu of available operations and ask the user to choose one.

Based on the user's choice, we perform the corresponding arithmetic operation using conditional statements (if, elif and else). If the user chooses division, we also check whether the second number is not zero to avoid division by zero error.

Finally, we display the result of the selected operation using print() statement.

Performance Metrics

19.41s Prediction Time
19.37s Total Time
All Input Parameters
{
  "top_p": 0.95,
  "prompt": "write python code for a simple calculator",
  "temperature": 0.7,
  "system_prompt": "Below is an instruction that describes a task. Write a response that appropriately completes the request.",
  "max_new_tokens": 512,
  "repetition_penalty": 1.15
}
Input Parameters
top_p Type: numberDefault: 0.95Range: 0.01 - 1
When decoding text, samples from the top p percentage of most likely tokens; lower to ignore less likely tokens
prompt Type: stringDefault: Tell me about AI
Your prompt
temperature Type: numberDefault: 0.7Range: 0 - 5
Randomness of outputs, 0 is deterministic, greater than 1 is random
system_prompt Type: stringDefault: Below is an instruction that describes a task. Write a response that appropriately completes the request.
System prompt that helps guide system behavior
max_new_tokens Type: integerDefault: 512Range: 1 - 4096
Number of new tokens
repetition_penalty Type: numberDefault: 1.15Range: 0 - 5
Penalty for repeated words in generated text; 1 is no penalty, values greater than 1 discourage repetition, less than 1 encourage it
Output Schema

Output

Type: string

Version Details
Version ID
c4798dbaf5104519a74b43dc2574b13012a74714c2c43f555c6ccb9b8e0a6b74
Version Created
August 30, 2023
Run on Replicate →