Very limited model response... am I doing something wrong?

#2
by echa00 - opened

Tried the following prompt and the response was worse than 'Mistral-7B-Instruct-v0.3' without the Japanese fine-tuning. Am I doing something wrong?

import requests

API_URL = "XXX"
headers = {
    "Accept" : "application/json",
    "Authorization": "Bearer YYY",
    "Content-Type": "application/json" 
}

def query(payload):
    response = requests.post(API_URL, headers=headers, json=payload)
    return response.json()

system_prompt = "You are a Japanese language teacher. Your task is to draft a beginner-level Japanese roleplay for making a restaurant reservation, focusing on specifying any dietary restrictions or special requests. Output the dialogue in JSON format with only the following keys: 'Japanese' and 'speaker'. "
prompt = "Draft a beginner-level Japanese roleplay to help me practice making a restaurant reservation, focusing on specifying any dietary restrictions or special requests. Use real-life examples."

msg = "<s> [INST] "+system_prompt+" \n "+prompt+" [/INST]"

output = query({
    "inputs": msg,
    "parameters": {
        "top_k": 50,
        "top_p": 0.95,
        "temperature": 0.7,
        "max_new_tokens": 1024
    }
})

print(output)

The issue might be your prompt formatting. From what I've worked with rakuten, your prompt should be "General Instructions \n USER:\n user provided instructions\n ASSISTANT:\n". The model likes to follow this format. In my experience, passing any general instructions didn't really help, I've contained my prompt only to the user section and that works best for me. In general it is a bit finnicky with instructions and sometimes it will just keep babbling random stuff if it doesn't like your prompt.

Sign up or log in to comment