Seems the code generation is failing 100%
Anyone have any suggestions? Backend issues like this normal where code does not get produced only paragraph text?
Thanks!
Seems the code generation is failing 100%
Anyone have any suggestions? Backend issues like this normal where code does not get produced only paragraph text?
Thanks!
Is this ChatGPT? API?
What’s your prompt?
Any prompt that I ask for code right now will not produce any body code.
gpt4
I even accessed s secondary workspace and ran into the same issue.
Have you tried starting a new thread?
If it still doesn’t work in a fresh thread, I’d try back. There were some reports on ChatGPT on status.openai.com today, I believe…
Yeah fresh thread, Cracked open my secondary account, fresh thread… All no go.
Yeah… time will tell. Funny how it spits out only one line of code… it has been working great for the most part since I had my account open.
Could be you’re asking too much. I’ve noticed it does that (you can fill the rest yourself here) if it doesn’t “think” it has enough tokens because you’re request is huge. Can you try breaking it down to a simpler prompt asking for one thing at once? What is the OG prompt?
You could try to ask it to give you only code and no explanation. Or find a model better suited for code. There’s quite a few now.
I am experiencing this as well. Fresh conversations, cookies cleared, across multiple different models. Seems to be freezing
It’s having trouble specifically with generating XML files right now, regular code is no problem though.
See for yourself, ask it to generate a sample XML for use in android studio, if it works for you right now I’d be surprised.
Same here. I am asking questions about Javascript and it keeps going into an infinite loop. I did not ask for an example of that topic.
yeah you can see where it tried to do the Step 2: twice.
So far it seems the xml generation is causing issues while the .java was generated pretty fast.
SOLVED:
Here’s the non-XML breakdown:
declare-styleable
named GearButtonView
.shape
inside the GearButtonView
styleable.shape
with values:
0
for circle
1
for rectangle
0
for the circle.After defining these attributes, you can access them in your Java code. Here’s how you can modify the init
method to use the shape
attribute:
init
MethodTypedArray
to obtain the styled attributes from context
and attrs
.shape
attribute using getInt
method, with 0
as the default value to fallback to circle
.currentShape
based on the retrieved value.init
Method:shape
attribute from the TypedArray
.currentShape
to Shape.CIRCLE
or Shape.RECTANGLE
based on the fetched value.recycle
on your TypedArray
to free up memory.TEMP SOLUTION
24h Later. Still broken but a work around has been figured out!
I was thinking if all xml generation is trying to output it needs a method of outputting without issue… Lets just use Mr. Json
And it will output a nice json file that holds the same xml data
Solution is requesting for JSON instead of XML will work!
here is a working python script (needs more work) to convert android outputed json to xml njoy
import json
import xml.etree.ElementTree as ET
from xml.dom import minidom
import argparse
import html
# Declare the Android namespace globally
ANDROID_NS = 'http://schemas.android.com/apk/res/android'
ET.register_namespace('android', ANDROID_NS)
def json_to_xml(json_data):
def build_xml_element(data, tag):
# Handle special namespace prefix for Android
element = ET.Element(tag.split('.')[-1]) # Use only the class name as the tag
# Handle attributes and children separately
for key, value in data.items():
if key == 'android:children':
for child in value:
# Recursively handle child elements
child_tag = list(child.keys())[0]
child_element = build_xml_element(child[child_tag], child_tag)
element.append(child_element)
else:
# Attributes need to use the correct namespace
attribute_name = key.replace(':', '}')
attribute_name = f"{{{ANDROID_NS}}}{attribute_name.split('}')[-1]}"
element.set(attribute_name, value)
return element
# Start with the root element from JSON
root_key = next(iter(json_data))
root_element = build_xml_element(json_data[root_key], root_key)
return root_element
def main():
parser = argparse.ArgumentParser(description='Convert JSON to XML for Android layout.')
parser.add_argument('input_json', type=str, help='Input JSON file path')
parser.add_argument('output_xml', type=str, help='Output XML file path')
args = parser.parse_args()
with open(args.input_json, 'r') as file:
data = json.load(file)
root_element = json_to_xml(data)
# Generate pretty printed XML string using minidom
rough_string = ET.tostring(root_element, 'utf-8')
reparsed = minidom.parseString(rough_string)
pretty_xml_as_string = reparsed.toprettyxml(indent=" ")
# Write the pretty-printed XML to file
with open(args.output_xml, 'w') as output_file:
output_file.write(pretty_xml_as_string)
print(f"Formatted Android XML file created successfully: {args.output_xml}")
if __name__ == "__main__":
main()
Has anyone else experience issues today with gpt-35. I am experiencing that it fails consequently to create code boxes and ends up in an endless loop.
I have been getting this for two days, it will not generate code, freezes and does that.