|
27 | 27 | - 🚀 **High Efficiency** - Leverage powerful LLMs for fast and accurate research, leveraging key information extraction techniques to further optimize token usage |
28 | 28 | - ⚙️ **Flexible Deployment** - Support local run and [ModelScope Studio](https://modelscope.cn/studios) on both CPU and GPU environments. |
29 | 29 | - 💰 **Free Model Inference** - Free LLM API inference calls for ModelScope users, refer to [ModelScope API-Inference](https://modelscope.cn/docs/model-service/API-Inference/intro) |
| 30 | + - 📚 **Export & Upload** - Support exporting research reports to PDF, PPTX, DOCX, HTML formats; support uploading reports to ModelScope, HuggingFace, GitHub |
30 | 31 |
|
31 | 32 |
|
32 | 33 | <br> |
@@ -102,6 +103,84 @@ ms-agent app --doc_research \ |
102 | 103 | > When running locally, the default address is http://0.0.0.0:7860/. If the page can't be accessed, try disabling proxy. |
103 | 104 |
|
104 | 105 |
|
| 106 | +### 4. Report Export |
| 107 | +DocResearch supports exporting markdown reports to various formats for easy archiving and sharing: |
| 108 | +- PDF |
| 109 | +- PPTX |
| 110 | +- HTML |
| 111 | +- DOCX |
| 112 | + |
| 113 | +**Examples of exporting using Python script:** |
| 114 | +```python |
| 115 | +from ms_agent.utils.markdown_converter import MarkdownConverter |
| 116 | + |
| 117 | +report_path: str = '/path/to/report_dir' |
| 118 | +output_path: str = '/path/to/output_dir' |
| 119 | + |
| 120 | +# Call export functions |
| 121 | +MarkdownConverter.markdown_to_html(report_path, output_path + "/html") |
| 122 | +MarkdownConverter.markdown_to_docx(report_path, output_path + "/docx") |
| 123 | +MarkdownConverter.markdown_to_pptx(report_path, output_path + "/pptx") |
| 124 | +MarkdownConverter.markdown_to_pdf(report_path, output_path + "/pdf") |
| 125 | +``` |
| 126 | + |
| 127 | + |
| 128 | +### 5. Report Uploading & Sharing |
| 129 | +DocResearch supports uploading generated markdown research reports to multiple platforms for easy sharing and collaboration: |
| 130 | +- **ModelScope** |
| 131 | +- **HuggingFace** |
| 132 | +- **GitHub** |
| 133 | + |
| 134 | +**Upload to ModelScope:** |
| 135 | +```python |
| 136 | +from ms_agent.utils.push_to_hub import PushToModelScope |
| 137 | + |
| 138 | +# Get the ModelScope token: https://modelscope.cn/my/myaccesstoken |
| 139 | +push_to_ms = PushToModelScope(token='ms-xxx') |
| 140 | + |
| 141 | +push_to_ms.push( |
| 142 | + repo_id='your-username/your-repo-name', |
| 143 | + folder_path='/path/to/report_dir', |
| 144 | + path_in_repo='report', |
| 145 | + commit_message='Upload research report to ModelScope', |
| 146 | +) |
| 147 | +``` |
| 148 | + |
| 149 | +**Upload to HuggingFace:** |
| 150 | +```python |
| 151 | +from ms_agent.utils.push_to_hub import PushToHuggingFace |
| 152 | + |
| 153 | +# Get the HuggingFace token: https://huggingface.co/settings/tokens |
| 154 | +push_to_hf = PushToHuggingFace(token='hf_xxx') |
| 155 | + |
| 156 | +push_to_hf.push( |
| 157 | + repo_id='your-username/your-repo-name', |
| 158 | + folder_path='/path/to/report_dir', |
| 159 | + path_in_repo='report', |
| 160 | + commit_message='Upload research report to HuggingFace', |
| 161 | +) |
| 162 | +``` |
| 163 | + |
| 164 | +**Upload to GitHub:** |
| 165 | +```python |
| 166 | +from ms_agent.utils.push_to_hub import PushToGitHub |
| 167 | + |
| 168 | +# Get the GitHub PAT(Personal Access Tokens): https://github.com/settings/tokens |
| 169 | +push_to_git = PushToGitHub( |
| 170 | + user_name = 'your-username', |
| 171 | + repo_name = 'your-repo-name', |
| 172 | + token = 'xxx', |
| 173 | + visibility = 'public', # `public` or `private` |
| 174 | + description = 'A repository for research reports generated by MS-Agent DocResearch',) |
| 175 | + |
| 176 | +push_to_git.push( |
| 177 | + folder_path='/path/to/report_dir', |
| 178 | + path_in_repo='report', |
| 179 | + commit_message='Upload research report to GitHub', |
| 180 | +) |
| 181 | +``` |
| 182 | + |
| 183 | + |
105 | 184 | <br> |
106 | 185 |
|
107 | 186 | ## Usage Instructions |
|
0 commit comments