SyedTahir/STHASI-Generative-AI-Documentation-Generator
0
1---2title: STHASI Generative AI Documentation Generator3emoji: ๐ 4colorFrom: purple5colorTo: pink6sdk: gradio7sdk_version: 5.49.18app_file: app.py9pinned: false10license: apache-2.011---12 13# ๐ Generative AI Documentation Generator14 15This is a [Hugging Face Space](link-to-your-space) that automatically generates technical documentation for Python codebases using the power of Large Language Models.16 17 <!-- It's a good idea to add a screenshot once your app is running -->18 19## โจ Features20 21- **Automated Documentation:** Simply provide a public GitHub repository URL, and the app will generate clear, concise documentation for each function and class.22- **Modern UI/UX:** A clean, responsive interface built with Gradio, featuring a dark mode theme.23- **Advanced - Ask Your Codebase:** An interactive chatbot that lets you ask natural language questions about the repository's code.24- **Powered by CodeLlama:** Utilizes `codellama/CodeLlama-7b-Instruct-hf` for high-quality, code-aware text generation.25 26## ๐ ๏ธ How It Works27 281. **Clone Repository:** The app clones the provided public GitHub repository into its temporary storage.292. **Parse Code:** It intelligently parses Python files using Abstract Syntax Trees (`ast`) to identify functions and classes, which is more reliable than simple text matching.303. **Generate Docs:** For each code element, it creates a detailed prompt and sends it to the CodeLlama model to generate a professional docstring, including purpose, parameters, return values, and usage examples.314. **Chat with Code:** The "Ask Your Codebase" feature combines the entire codebase into a single context, allowing the LLM to answer specific questions about the project's logic and structure.32 33## ๐ How to Use34 351. Open the **[Hugging Face Space](link-to-your-space)**.362. In the "Documentation Generator" tab, enter the URL of a public GitHub repository containing Python code.373. Click "Generate Docs" and wait for the process to complete. The status bar will show the current progress.384. Switch to the "Ask Your Codebase" tab, ensure the URL is entered, and ask any question about the code!