# examples **Repository Path**: moark/examples ## Basic Information - **Project Name**: examples - **Description**: 该仓库汇集模力方舟各类模型使用的示例代码 - **Primary Language**: Unknown - **License**: WTFPL - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 14 - **Forks**: 3 - **Created**: 2025-07-19 - **Last Updated**: 2026-03-26 ## Categories & Tags **Categories**: sample-code **Tags**: None ## README # Moark Serverless API Example Code [English](README-en.md) | [简体中文](README.md) This repository collects and showcases high-quality example code for using various Model Moark APIs and other APIs. If you have code that can help developers leverage the Moark platform, your contributions are welcome. ## Directory Structure Explanation The directories in this repository are organized by use case, with each directory containing code in various programming languages for models applicable to that scenario. The specific directory structure is as follows: - [3D](3D) - Example code for text-to-3D and image-to-3D generation - [documents](documents) - Example code related to document processing - [embeddings-and-reranker](embeddings-and-reranker) - Example code related to embeddings and reranking - [image-generation-processing](image-generation-processing) - Example code related to image generation and processing - [OCR](ocr) - Example code related to optical character recognition - [risk-control](risk-control) - Example code related to risk control - [speech-generation-recognition](speech-generation-recognition) - Example code related to speech generation and recognition - [text-completion](text-completion) - Example code related to text completion - [text-generation](text-generation) - Example code related to text generation - [vision-models](vision-models) - Example code related to vision models - [videos](videos) - Example code related to video processing ## Directory and File Naming Conventions Directory names should be in uppercase if they are abbreviations, e.g., `OCR`, and in lowercase if they are full names, e.g., `text-generation`, with multiple words connected by hyphens `-`. Each scenario directory contains a README.md introduction file and example code in various programming languages. Separate subdirectories are created for different programming languages, such as `python/`, `javascript/`, etc. Code files for each programming language are stored in the corresponding language directory, with filenames in lowercase and multiple words connected by underscores `_`, e.g., `text_completion_example.py`. ## API Example Code Repository Usage Guide Welcome to the API example code repository! This guide will help you quickly set up the development environment and run the example code. ### I. Environment Preparation #### Python Version Installation The APIs in this project are based on Python 3. Visit the [Python Official Website](https://www.python.org/) to download the installation package for your system. ### II. Repository Cloning and Dependency Installation #### 1. Clone the Repository Locally You can copy the following command to the terminal to clone this repository, or you can click the "Clone/Download" button in the repository and choose a method that suits you. ```git clone https://gitee.com/moark/examples.git``` #### 2. Install Dependencies Copy the following command to the terminal to install all the dependencies required by this project. ```pip install -r requirements.txt``` If the installation is slow, switch to a Python package mirror: ```pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple``` ### III. Configure API Token To run the API example code in the project, you need to create your own access token first. Please refer to the [Gitee AI Documentation](https://ai.gitee.com/docs/organization/access-token). ### IV. Run API Example Code Once the environment and token are configured, you can start testing and running the various API example code files. #### 1. Fill in the Token and Replace Prompts and File Paths Fill in the API token you created earlier and replace the content of `prompt`, `image`, `text`, and other parameters based on your test cases. #### 2. Run the Code Use `python filename.py` in the terminal or execute it directly in your IDE. ## Contribution Guide If you want to contribute code to the repository, please follow the process below: 1. Fork this repository. 2. Create a new branch: `git checkout -b feature/new-example` 3. Commit the code and push: `git push origin feature/new-example` 4. Create a pull request Thank you for using! If you have any questions, please submit an Issue.