Spaces:
Runtime error
Runtime error
Update app.py
Browse files15 unmodified lines1617181920212212 unmodified lines3536373839404142434445464715 unmodified linesprompt = f"Generate README for the following code:\n\n{code_input}"messages = [{"role": "system", "content": "You are CodeDocify, a highly efficient and intelligent assistant designed to analyze code and generate comprehensive, clear, and concise documentation. Your purpose is to help developers by producing well-structured README files and detailed explanations of their code. You aim to simplify complex code into easily understandable documentation, ensuring that your responses are accurate, professional, and easy to follow."},{"role": "user", "content": prompt}]12 unmodified lines# Gradio interfacedef process_code(code_input):documentation = generate_documentation(code_input)readme_file = io.BytesIO()readme_file.write(documentation.encode('utf-8'))readme_file.seek(0)return documentation, readme_file# Set up the Gradio app with Bootstrap, icons, and smileywith gr.Blocks(css=".container { font-family: 'Roboto', sans-serif; } .btn-primary { background-color: #007bff; } .icon { margin-right: 10px; }") as app:gr.Markdown("""#Code Documentation Generator15 unmodified lines1617181920212212 unmodified lines3536373839404142434445464715 unmodified linesprompt = f"Generate README for the following code:\n\n{code_input}"messages = [{"role": "system", "content": "You are ReadMe Forge, a highly efficient and intelligent assistant designed to analyze code and generate comprehensive, clear, and concise documentation. Your purpose is to help developers by producing well-structured README files and detailed explanations of their code. You aim to simplify complex code into easily understandable documentation, ensuring that your responses are accurate, professional, and easy to follow."},{"role": "user", "content": prompt}]12 unmodified lines# Gradio interfacedef process_code(code_input):documentation = generate_documentation(code_input)# Save the documentation to a README.md filefile_path = "README.md"with open(file_path, 'w', encoding='utf-8') as readme_file:readme_file.write(documentation)return documentation, file_pathwith gr.Blocks(css=".container { font-family: 'Roboto', sans-serif; } .btn-primary { background-color: #007bff; } .icon { margin-right: 10px; }") as app:gr.Markdown("""#Code Documentation Generator
app.py+6-6