Spaces:
Sleeping
Sleeping
changes
Browse files- README.md +4 -1
- scripts/download_models.py +22 -0
- scripts/try_model.py +105 -0
- src/dolly.py +0 -4
README.md
CHANGED
@@ -13,4 +13,7 @@ port: 7000
|
|
13 |
|
14 |
|
15 |
|
16 |
-
|
|
|
|
|
|
|
|
13 |
|
14 |
|
15 |
|
16 |
+
|
17 |
+
## Working Model
|
18 |
+
|
19 |
+
- gpt2
|
scripts/download_models.py
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from huggingface_hub import snapshot_download
|
2 |
+
|
3 |
+
# model = "databricks/dolly-v2-3b"
|
4 |
+
model = "bigcode/starcoder"
|
5 |
+
# Downloading (β¦)neration_config.json: 100%|ββββββββββββββββββββββββββββββββββββββββββββββββββββββ| 111/111 [00:00<?, ?B/s]
|
6 |
+
# Downloading (β¦)168695aef2/README.md: 100%|ββββββββββββββββββββββββββββββββββββββββββ| 11.2k/11.2k [00:00<00:00, 1.60MB/s]
|
7 |
+
# Downloading (β¦)168695aef2/README.md: 0%| | 0.00/11.2k [00:00<?, ?B/s]
|
8 |
+
# Downloading (β¦)l-00007-of-00007.bin: 3%|ββ | 126M/4.08G [06:29<3:59:06, 276kB/s]
|
9 |
+
# Downloading (β¦)l-00005-of-00007.bin: 1%|β | 126M/9.85G [06:49<8:50:16, 306kB/s]
|
10 |
+
# Downloading (β¦)l-00006-of-00007.bin: 1%|β | 136M/9.86G [07:02<10:50:28, 249kB/s]
|
11 |
+
# Downloading (β¦)l-00004-of-00007.bin: 1%|β | 126M/9.86G [07:01<9:48:12, 276kB/s]
|
12 |
+
# Downloading (β¦)l-00003-of-00007.bin: 1%|β | 126M/9.85G [06:48<8:48:11, 307kB/s]
|
13 |
+
|
14 |
+
model = "tiiuae/falcon-7b"
|
15 |
+
# model = "bigcode/santacoder"
|
16 |
+
# model = "bigscience/bloom-560m"
|
17 |
+
|
18 |
+
print(f"Downloading model: {model}...")
|
19 |
+
|
20 |
+
snapshot_download(repo_id=model)
|
21 |
+
|
22 |
+
print('Dowmload complete!')
|
scripts/try_model.py
ADDED
@@ -0,0 +1,105 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import torch
|
2 |
+
import transformers
|
3 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
4 |
+
|
5 |
+
# model="databricks/dolly-v2-3b"
|
6 |
+
model = "tiiuae/falcon-7b"
|
7 |
+
# model = "gpt2"
|
8 |
+
# model = "bigcode/santacoder"
|
9 |
+
# model = "bigscience/bloom-560m"
|
10 |
+
|
11 |
+
|
12 |
+
print(f'Model loaded: {model}')
|
13 |
+
|
14 |
+
generate_text = transformers.pipeline(model=model, torch_dtype=torch.bfloat16, trust_remote_code=True, device_map="auto")
|
15 |
+
|
16 |
+
|
17 |
+
prompt = """
|
18 |
+
# EngSys Studio
|
19 |
+
|
20 |
+
EngSys Studio is a tool to help you extract data from Kusto with a simple query.
|
21 |
+
|
22 |
+
## Consider Following Kusto Schema:
|
23 |
+
```
|
24 |
+
android_build_time (EventInfo_Time, EventInfo_Name, EventInfo_BaseType, EventInfo_Source,
|
25 |
+
PipelineInfo_AccountId, Username, UserEmail, modelName, totalCores, Build_Date, Build_Time, taskData,
|
26 |
+
processorName, task, deviceId, memory, timezone, l3Cache, processorSpeed, modelIdentifier,
|
27 |
+
numberOfProcessor, PipelineInfo_IngestionTime, PipelineInfo_ClientIp, PipelineInfo_ClientCountry, os,
|
28 |
+
MachineName, sha, cleanBuild, totalTaskTime, versionName, EventInfo_SdkVersion,
|
29 |
+
PipelineInfo_RoutingGeo, modulesChanged);
|
30 |
+
|
31 |
+
android_test_telemetry (test_case_name, test_case_path, phase_name, source_branch, test_case_outcome
|
32 |
+
(enum: success, failure), build_id, commit_sha, test_case_rerun_count, test_user_account,
|
33 |
+
test_case_type, sign_in_flow, pipeline_name, testcase_index, time_taken, device_id, pull_request_id,
|
34 |
+
pipeline_id, build_rerun_count, PipelineInfo_IngestionTime, PipelineInfo_ClientIp,
|
35 |
+
PipelineInfo_ClientCountry, stacktrace, error_message, pre_signin, PipelineInfo_RoutingGeo, testGuid,
|
36 |
+
goldenGuid, diffGuid, rerun, EventInfo_Time); shield_prod (EventInfo_Time, EventInfo_Name,
|
37 |
+
EventInfo_BaseType, EventInfo_Source, PipelineInfo_AccountId, org, project, repository,
|
38 |
+
pull_request_id, pr_title, committer_name, committer_alias, source_branch, target_branch, work_items,
|
39 |
+
area_paths, name, overrides, overridden_by, status, message, exception, error, event_time,
|
40 |
+
PipelineInfo_IngestionTime, PipelineInfo_ClientIp, PipelineInfo_ClientCountry, callback_results,
|
41 |
+
suggestion, PipelineInfo_RoutingGeo); build_metadata (EventInfo_Time, EventInfo_Name,
|
42 |
+
EventInfo_BaseType, EventInfo_Source, PipelineInfo_AccountId, EventInfo_SdkVersion, plans, buildNumber,
|
43 |
+
status, result, queueTime, startTime, finishTime, url, definition_path, definition_type,
|
44 |
+
definition_name, definition_url, definition_project_id, definition_project_name,
|
45 |
+
definition_project_url, definition_project_state, project_id, project_name, project_url, project_state,
|
46 |
+
uri, sourceBranch, sourceVersion, queue_pool_name, queue_name, priority, reason, requestedFor_id,
|
47 |
+
requestedFor_displayName, requestedFor_uniqueName, requestedFor_url, requestedFor_imageUrl,
|
48 |
+
requestedBy_id, requestedBy_displayName, requestedBy_uniqueName, requestedBy_url, requestedBy_imageUrl,
|
49 |
+
lastChangedDate, lastChangedBy_id, lastChangedBy_displayName, lastChangedBy_uniqueName,
|
50 |
+
lastChangedBy_url, lastChangedBy_imageUrl, orchestrationPlan_planId, logs_type, logs_url,
|
51 |
+
repository_id, repository_type, EventInfo_OriginalTime, PipelineInfo_IngestionTime,
|
52 |
+
PipelineInfo_ClientIp, PipelineInfo_ClientCountry, PipelineInfo_IngestionPath, id, definition_revision,
|
53 |
+
definition_id);
|
54 |
+
```
|
55 |
+
|
56 |
+
## Examples:
|
57 |
+
Q: Last 5 Build time for Android:
|
58 |
+
A: android_build_time | take 5
|
59 |
+
Q: Whats the reliability of the android test "testEnterpriseE3NavigateSavedMessagesPageDetails"
|
60 |
+
A: android_test_telemetry
|
61 |
+
| where test_case_name == "testEnterpriseE3NavigateSavedMessagesPageDetails"
|
62 |
+
| where test_case_outcome == "success" or test_case_outcome == "failure"
|
63 |
+
| summarize success_count=countif(test_case_outcome == "success"),
|
64 |
+
failure_count=countif(test_case_outcome == "failure")
|
65 |
+
| extend reliability = success_count * 1.0 / (success_count + failure_count)
|
66 |
+
Q: Build time for iOS:
|
67 |
+
A: ios_build_time
|
68 |
+
|
69 |
+
## Notes:
|
70 |
+
- For ios, use the same table schema, just replace android with ios
|
71 |
+
- also, ios test name has suffix () in it
|
72 |
+
|
73 |
+
## User Input:
|
74 |
+
when did "testEnterpriseE3NavigateSavedMessagesPageDetails" android test last fail? What where the
|
75 |
+
error messages, build id.
|
76 |
+
|
77 |
+
## Please make sure you return Kusto Query without any explaination
|
78 |
+
"""
|
79 |
+
|
80 |
+
# prompt = 'Write a code in python to print hello world in loop for 100 times'
|
81 |
+
|
82 |
+
reponse = generate_text(prompt)
|
83 |
+
print(f'{reponse=}')
|
84 |
+
|
85 |
+
|
86 |
+
|
87 |
+
# tokenizer = AutoTokenizer.from_pretrained(model)
|
88 |
+
# pipeline = transformers.pipeline(
|
89 |
+
# "text-generation",
|
90 |
+
# model=model,
|
91 |
+
# tokenizer=tokenizer,
|
92 |
+
# torch_dtype=torch.bfloat16,
|
93 |
+
# trust_remote_code=True,
|
94 |
+
# device_map="auto",
|
95 |
+
# )
|
96 |
+
# sequences = pipeline(
|
97 |
+
# "Girafatron is obsessed with giraffes, the most glorious animal on the face of this Earth. Giraftron believes all other animals are irrelevant when compared to the glorious majesty of the giraffe.\nDaniel: Hello, Girafatron!\nGirafatron:",
|
98 |
+
# max_length=200,
|
99 |
+
# do_sample=True,
|
100 |
+
# top_k=10,
|
101 |
+
# num_return_sequences=1,
|
102 |
+
# eos_token_id=tokenizer.eos_token_id,
|
103 |
+
# )
|
104 |
+
# for seq in sequences:
|
105 |
+
# print(f"Result: {seq['generated_text']}")
|
src/dolly.py
DELETED
@@ -1,4 +0,0 @@
|
|
1 |
-
import torch
|
2 |
-
from transformers import pipeline
|
3 |
-
|
4 |
-
generate_text = pipeline(model="databricks/dolly-v2-3b", torch_dtype=torch.bfloat16, trust_remote_code=True, device_map="auto")
|
|
|
|
|
|
|
|
|
|