This repository has been archived by the owner on Oct 25, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 211
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Sun, Xuehao <[email protected]>
- Loading branch information
1 parent
e1f4666
commit 4fd914d
Showing
112 changed files
with
17,519 additions
and
16,234 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
PyTorch Optimizer | ||
============== | ||
|
||
.. autoapisummary:: | ||
|
||
intel_extension_for_transformers.transformers.optimizer.NoTrainerOptimizer | ||
intel_extension_for_transformers.transformers.optimizer.Orchestrate_optimizer | ||
PyTorch Optimizer | ||
============== | ||
|
||
.. autoapisummary:: | ||
|
||
intel_extension_for_transformers.transformers.optimizer.NoTrainerOptimizer | ||
intel_extension_for_transformers.transformers.optimizer.Orchestrate_optimizer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
Trainer | ||
============== | ||
|
||
.. autoapisummary:: | ||
|
||
Trainer | ||
============== | ||
|
||
.. autoapisummary:: | ||
|
||
intel_extension_for_transformers.transformers.trainer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,37 @@ | ||
@ECHO OFF | ||
|
||
pushd %~dp0 | ||
|
||
REM Command file for Sphinx documentation | ||
|
||
#set SPHINXBUILD=sphinx-multiversion | ||
|
||
if "%SPHINXBUILD%" == "" ( | ||
set SPHINXBUILD=sphinx-build | ||
) | ||
set SOURCEDIR=source | ||
set BUILDDIR=build | ||
|
||
%SPHINXBUILD% >NUL 2>NUL | ||
if errorlevel 9009 ( | ||
echo. | ||
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx | ||
echo.installed, then set the SPHINXBUILD environment variable to point | ||
echo.to the full path of the 'sphinx-build' executable. Alternatively you | ||
echo.may add the Sphinx directory to PATH. | ||
echo. | ||
echo.If you don't have Sphinx installed, grab it from | ||
echo.https://www.sphinx-doc.org/ | ||
exit /b 1 | ||
) | ||
|
||
if "%1" == "" goto help | ||
|
||
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% | ||
goto end | ||
|
||
:help | ||
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% | ||
|
||
:end | ||
popd | ||
@ECHO OFF | ||
|
||
pushd %~dp0 | ||
|
||
REM Command file for Sphinx documentation | ||
|
||
#set SPHINXBUILD=sphinx-multiversion | ||
|
||
if "%SPHINXBUILD%" == "" ( | ||
set SPHINXBUILD=sphinx-build | ||
) | ||
set SOURCEDIR=source | ||
set BUILDDIR=build | ||
|
||
%SPHINXBUILD% >NUL 2>NUL | ||
if errorlevel 9009 ( | ||
echo. | ||
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx | ||
echo.installed, then set the SPHINXBUILD environment variable to point | ||
echo.to the full path of the 'sphinx-build' executable. Alternatively you | ||
echo.may add the Sphinx directory to PATH. | ||
echo. | ||
echo.If you don't have Sphinx installed, grab it from | ||
echo.https://www.sphinx-doc.org/ | ||
exit /b 1 | ||
) | ||
|
||
if "%1" == "" goto help | ||
|
||
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% | ||
goto end | ||
|
||
:help | ||
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% | ||
|
||
:end | ||
popd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,69 +1,69 @@ | ||
import os, sys | ||
import glob | ||
|
||
def find_index_path(index_file): | ||
with open(index_file, "r") as f: | ||
lines = f.readlines() | ||
for line in lines: | ||
pos = line.find('index.html" class="icon icon-home"') | ||
if pos<0: | ||
continue | ||
pos1 = line.rfind("\"", 0, pos) | ||
if pos1<0: | ||
return "" | ||
else: | ||
return "../" + line[pos1+1: pos] | ||
return "ignore" | ||
|
||
def update_version_link(version, folder_name, index_file): | ||
index_buf = "" | ||
index_path = find_index_path(index_file) | ||
if index_path=='ignore': | ||
return | ||
|
||
with open(index_file, "r") as f: | ||
index_buf = f.read() | ||
key_str=' <div class="version">\n {}\n </div>'.format(version) | ||
version_list = '''<div class="version"> | ||
<a href="{}versions.html">{}▼</a> | ||
<p>Click link above to switch version</p> | ||
</div>'''.format(index_path, folder_name) | ||
#print(index_buf.find(key_str)) | ||
index_buf = index_buf.replace(key_str, version_list) | ||
#print(index_buf) | ||
|
||
with open(index_file, "w") as f: | ||
f.write(index_buf) | ||
|
||
|
||
def update_source_url(version, folder_name, index_file): | ||
if 'latest'!= folder_name: | ||
return | ||
|
||
base_url = "class=\"reference external\" href=\"https://github.com/intel/intel-extension-for-transformers/tree/{}/" | ||
repo_url = base_url.format("v"+version) | ||
target = base_url.format("master") | ||
with open(index_file, "r") as f: | ||
index_buf = f.read() | ||
index_buf = index_buf.replace(repo_url, target) | ||
|
||
with open(index_file, "w") as f: | ||
f.write(index_buf) | ||
|
||
def main(folder, version): | ||
folder_name=os.path.basename(folder) | ||
for index_file in glob.glob('{}/**/*.html'.format(folder),recursive = True): | ||
update_version_link(version, folder_name, index_file) | ||
update_source_url(version, folder_name, index_file) | ||
|
||
def help(me): | ||
print("python {} html_folder version".format(me)) | ||
|
||
if __name__=="__main__": | ||
if len(sys.argv)<3: | ||
help(sys.argv[0]) | ||
sys.exit(1) | ||
|
||
folder = sys.argv[1] | ||
version = sys.argv[2] | ||
main(folder, version) | ||
import os, sys | ||
import glob | ||
|
||
def find_index_path(index_file): | ||
with open(index_file, "r") as f: | ||
lines = f.readlines() | ||
for line in lines: | ||
pos = line.find('index.html" class="icon icon-home"') | ||
if pos<0: | ||
continue | ||
pos1 = line.rfind("\"", 0, pos) | ||
if pos1<0: | ||
return "" | ||
else: | ||
return "../" + line[pos1+1: pos] | ||
return "ignore" | ||
|
||
def update_version_link(version, folder_name, index_file): | ||
index_buf = "" | ||
index_path = find_index_path(index_file) | ||
if index_path=='ignore': | ||
return | ||
|
||
with open(index_file, "r") as f: | ||
index_buf = f.read() | ||
key_str=' <div class="version">\n {}\n </div>'.format(version) | ||
version_list = '''<div class="version"> | ||
<a href="{}versions.html">{}▼</a> | ||
<p>Click link above to switch version</p> | ||
</div>'''.format(index_path, folder_name) | ||
#print(index_buf.find(key_str)) | ||
index_buf = index_buf.replace(key_str, version_list) | ||
#print(index_buf) | ||
|
||
with open(index_file, "w") as f: | ||
f.write(index_buf) | ||
|
||
|
||
def update_source_url(version, folder_name, index_file): | ||
if 'latest'!= folder_name: | ||
return | ||
|
||
base_url = "class=\"reference external\" href=\"https://github.com/intel/intel-extension-for-transformers/tree/{}/" | ||
repo_url = base_url.format("v"+version) | ||
target = base_url.format("master") | ||
with open(index_file, "r") as f: | ||
index_buf = f.read() | ||
index_buf = index_buf.replace(repo_url, target) | ||
|
||
with open(index_file, "w") as f: | ||
f.write(index_buf) | ||
|
||
def main(folder, version): | ||
folder_name=os.path.basename(folder) | ||
for index_file in glob.glob('{}/**/*.html'.format(folder),recursive = True): | ||
update_version_link(version, folder_name, index_file) | ||
update_source_url(version, folder_name, index_file) | ||
|
||
def help(me): | ||
print("python {} html_folder version".format(me)) | ||
|
||
if __name__=="__main__": | ||
if len(sys.argv)<3: | ||
help(sys.argv[0]) | ||
sys.exit(1) | ||
|
||
folder = sys.argv[1] | ||
version = sys.argv[2] | ||
main(folder, version) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,32 @@ | ||
import os, sys | ||
|
||
|
||
def main(folder, version): | ||
folder_name=os.path.basename(folder) | ||
|
||
version_file = "{}/versions.html".format(os.path.dirname(folder)) | ||
#print(version_file) | ||
ver_buf = "" | ||
with open(version_file, "r") as f: | ||
ver_buf = f.read() | ||
if ver_buf.find(version)>=0: | ||
return | ||
key_str = '<li><a href="latest">latest</a></li>' | ||
new_ver = '''<li><a href="latest">latest</a></li> | ||
<li><a href="{}">{}</a></li>'''.format(version, version) | ||
ver_buf = ver_buf.replace(key_str, new_ver) | ||
|
||
with open(version_file, "w") as f: | ||
f.write(ver_buf) | ||
|
||
def help(me): | ||
print("python {} html_folder version".format(me)) | ||
|
||
if __name__=="__main__": | ||
if len(sys.argv)<3: | ||
help(sys.argv[0]) | ||
sys.exit(1) | ||
|
||
folder = sys.argv[1] | ||
version = sys.argv[2] | ||
main(folder, version) | ||
import os, sys | ||
|
||
|
||
def main(folder, version): | ||
folder_name=os.path.basename(folder) | ||
|
||
version_file = "{}/versions.html".format(os.path.dirname(folder)) | ||
#print(version_file) | ||
ver_buf = "" | ||
with open(version_file, "r") as f: | ||
ver_buf = f.read() | ||
if ver_buf.find(version)>=0: | ||
return | ||
key_str = '<li><a href="latest">latest</a></li>' | ||
new_ver = '''<li><a href="latest">latest</a></li> | ||
<li><a href="{}">{}</a></li>'''.format(version, version) | ||
ver_buf = ver_buf.replace(key_str, new_ver) | ||
|
||
with open(version_file, "w") as f: | ||
f.write(ver_buf) | ||
|
||
def help(me): | ||
print("python {} html_folder version".format(me)) | ||
|
||
if __name__=="__main__": | ||
if len(sys.argv)<3: | ||
help(sys.argv[0]) | ||
sys.exit(1) | ||
|
||
folder = sys.argv[1] | ||
version = sys.argv[2] | ||
main(folder, version) |
Oops, something went wrong.