Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Commit
·
82dc28f
1
Parent(s):
ba642f0
For now, plot a summary for all repos
Browse files
evaluations/documentation.py
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
from .utils import log
|
2 |
import re
|
3 |
import numpy as np
|
4 |
|
@@ -21,6 +21,12 @@ def evaluate(verbose, llm, zip, readme):
|
|
21 |
log(verbose, "LOG", "Readme file contains python examples.")
|
22 |
overall = "Yes"
|
23 |
return overall
|
|
|
|
|
|
|
|
|
|
|
|
|
24 |
|
25 |
if (llm):
|
26 |
prompt = f'{readme}\n \
|
|
|
1 |
+
from .utils import log,fetch_code
|
2 |
import re
|
3 |
import numpy as np
|
4 |
|
|
|
21 |
log(verbose, "LOG", "Readme file contains python examples.")
|
22 |
overall = "Yes"
|
23 |
return overall
|
24 |
+
|
25 |
+
if (llm):
|
26 |
+
code = fetch_code(zip)
|
27 |
+
if (llm):
|
28 |
+
summary = llm.predict("HELP", f"{code}\nBased on the readme file above can you give a quick summary of this repository? Please use references to file names on the repository.")
|
29 |
+
log(verbose, "LOG", f"Based on the code, your readme file could be something like...\n{summary}")
|
30 |
|
31 |
if (llm):
|
32 |
prompt = f'{readme}\n \
|
evaluations/repo_evaluations.py
CHANGED
@@ -42,11 +42,6 @@ def evaluate(llm, verbose, repo_url, title=None, year=None):
|
|
42 |
zip = zipfile.ZipFile(repository_zip_name)
|
43 |
readme = fetch_readme(zip)
|
44 |
|
45 |
-
if (llm):
|
46 |
-
if (readme != ""):
|
47 |
-
summary = llm.predict("HELP", f"{readme}\nBased on the readme file above can you give a quick summary of this repository?")
|
48 |
-
log(verbose, "LOG", f"Summary: {summary}")
|
49 |
-
|
50 |
results["pred_stars"] = fetch_repo_stars(verbose, repo_url, token)
|
51 |
|
52 |
results["pred_license"] = license.evaluate(verbose, llm, zip, readme)
|
|
|
42 |
zip = zipfile.ZipFile(repository_zip_name)
|
43 |
readme = fetch_readme(zip)
|
44 |
|
|
|
|
|
|
|
|
|
|
|
45 |
results["pred_stars"] = fetch_repo_stars(verbose, repo_url, token)
|
46 |
|
47 |
results["pred_license"] = license.evaluate(verbose, llm, zip, readme)
|