Open baswenneker opened 3 months ago
Hey @baswenneker thanks for reporting the issue. I would recommend to try it again with gpt-4.
Meanwhile I will work on a fix for it.
@shahules786 I'm using GPT-4 already. Tried like 20 times without any luck. A manual on how to rewrite the prompts by hand would be nice!
Hey @baswenneker lemme try this out. We are currently changing some structures related to prompt - so I can test your case as well. thank you
Cool, let me know if I can help @shahules786!
@shahules786 I added an extra set of examples to the translation prompts and it worked. I made a pull request for this:
Had the same issue for french, so I made a pull request adding examples for french: #857
I had the same issue, indeed for dutch. It occurs because ' {'relevant_contexts': [1, 2]}]' cannot be translated in the adapt function and therefore example[-1] in prompt.py is of a strange with text added to it. And then the json_loader._safe_load(example[-1], llm) returns an empty dict {}. Which does not correspond to the output_keys[i] whichis 'relevant_contexts'. I fixed it by replacing: _example_dict[self.output_key] = ( json_loader._safe_load(example[-1], llm) if self.outputtype.lower() == "json" else example[-1] ) With if self.output_type.lower() == "json": example_dict[self.output_key] = json_loader._safe_load(example[-1], llm) if example_dict[self.output_key] == {}:
dict_str = example[-1].split('(')[0].strip()
example_dict[self.output_key ] = ast.literal_eval(dict_str)
else:
example_dict[self.output_key] = example[-1]
Which strips example[-1] and turns it into a string, which can be used. I know its not the neatest solutions, I will try to improve that. Hope it helps
Same issue here! Fellow Dutchie ;) I did the following:
convert metric prompts to Dutch with 4o ragas_metrics_nl.txt
and voila!
Describe the bug Can't get the automatic language adaption going for testset generation. I retried this about 10 times.
Ragas version: 0.1.4 Python version: 3.11
Code to Reproduce Share code to reproduce the issue
This is the output until it errors out:
Error trace
Expected behavior No error!
Additional context Using langchain with azure openai endpoint.