-
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Start to split functions into separate modules * Fixed an issue in the main script where it loads the old fine tune model
- Loading branch information
1 parent
b2d30cb
commit f8cb8d6
Showing
5 changed files
with
71 additions
and
63 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import requests | ||
from tqdm import tqdm | ||
import re | ||
|
||
def fine_tune_model_dl(): | ||
print("Downloading fine-tuned model... [Via OneDrive (Public)]") | ||
url = "https://onedrive.live.com/download?cid=22FB8D582DCFA12B&resid=22FB8D582DCFA12B%21456432&authkey=AIRKZih0go6iUTs" | ||
r = requests.get(url, stream=True) | ||
total_length = int(r.headers.get('content-length')) | ||
with tqdm(total=total_length, unit='B', unit_scale=True, unit_divisor=1024) as pbar: | ||
with open("models/fine_tuned_model-v2.pt", "wb") as f: | ||
for chunk in r.iter_content(chunk_size=1024): | ||
if chunk: | ||
f.write(chunk) | ||
pbar.update(1024) | ||
print("Fine-tuned model downloaded.") | ||
|
||
def fine_tune_model_dl_compressed(): | ||
print("Downloading fine-tuned compressed model... [Via OneDrive (Public)]") | ||
url = "https://onedrive.live.com/download?cid=22FB8D582DCFA12B&resid=22FB8D582DCFA12B%21456433&authkey=AOTrQ949dOFhdxQ" | ||
r = requests.get(url, stream=True) | ||
total_length = int(r.headers.get('content-length')) | ||
with tqdm(total=total_length, unit='B', unit_scale=True, unit_divisor=1024) as pbar: | ||
with open("models/fine_tuned_model_compressed_v2.pt", "wb") as f: | ||
for chunk in r.iter_content(chunk_size=1024): | ||
if chunk: | ||
f.write(chunk) | ||
pbar.update(1024) | ||
print("Fine-tuned model (compressed) downloaded.") |
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 |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import requests | ||
import re | ||
|
||
version = "1.0.9971" | ||
ScriptCreator = "cyberofficial" | ||
GitHubRepo = "https://github.com/cyberofficial/Synthalingua" | ||
repo_owner = "cyberofficial" | ||
repo_name = "Synthalingua" | ||
|
||
def get_remote_version(repo_owner, repo_name, file_path): | ||
url = f"https://raw.githubusercontent.com/{repo_owner}/{repo_name}/master/{file_path}" | ||
response = requests.get(url) | ||
|
||
if response.status_code == 200: | ||
remote_file_content = response.text | ||
version_search = re.search(r'version\s*=\s*"([\d.]+)"', remote_file_content) | ||
if version_search: | ||
remote_version = version_search.group(1) | ||
return remote_version | ||
else: | ||
print("Error: Version not found in the remote file.") | ||
return None | ||
else: | ||
print(f"An error occurred. Status code: {response.status_code}") | ||
return None | ||
|
||
def check_for_updates(): | ||
local_version = version | ||
remote_version = get_remote_version(repo_owner, repo_name, "transcribe_audio.py") | ||
|
||
if remote_version is not None: | ||
if remote_version != local_version: | ||
print(f"Version mismatch. Local version: {local_version}, remote version: {remote_version}") | ||
print("Consider updating to the latest version.") | ||
print(f"Update available at: " + GitHubRepo) | ||
else: | ||
print("You are already using the latest version.") | ||
print(f"Current version: {local_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