From Utils import get_prebuild_trulens_recorder

Unable to import this utils in my local. Can someone help me in identifying the package name

Hi @Jimmy0Jimmy

Welcome to the community.

You can try this:

Keep in mind that this screenshots are from another course. So, just take it as a reference.

One more thing, don’t forget to store this module in the main root of your project in order to be able to import it properly.

I hope this help

Best regards

3 Likes

Hi,

I have not understood whether I can use utils.py with a project of mine or it is specific to the examples of the course.

There is no need for some type of ground truth labels that I should provide?

Thank you,

Alexander Konstantinidis

Hi @ALEXANDER_KONSTANTIN

The utils.py package it is a custom module. It is specific to the examples of the course.

It is more like a helper module to present the examples more easily.

Best regards

Thank you!

By taking this mini course will I learn to use the trulens library to evaluate my own RAG applications? I mean the per-requisites, etc.

And one more question please…

I am getting an error message when I run the following line:

tru.run_dashboard()

The error message seems to relate to streamlit --which I have installed and upgraded-- and is the following. Is there something you would propose?

Hi @ALEXANDER_KONSTANTIN

The course is more like a entry level course. In that case, it is expected the it wasn’t cover all the topics regards this subject.

Unfortunately the error doesn’t appears to me in your post. Would you please post it again?

Thank you for letting me know.

Here is the error message again:

tru.run_dashboard()

Starting dashboard …
Config file already exists. Skipping writing process.
Credentials file already exists. Skipping writing process.


FileNotFoundError Traceback (most recent call last)
Cell In[36], line 2
1 # launches on http://localhost:8501/
----> 2 tru.run_dashboard()

File ~\anaconda3\Lib\site-packages\trulens_eval\tru.py:543, in Tru.run_dashboard(self, force, _dev)
540 env_opts[‘env’] = os.environ
541 env_opts[‘env’][‘PYTHONPATH’] = str(_dev)
→ 543 proc = subprocess.Popen(
544 [
545 “streamlit”, “run”, “–server.headless=True”, leaderboard_path,
546 “–”, “–database-url”,
547 self.db.engine.url.render_as_string(hide_password=False)
548 ],
549 stdout=subprocess.PIPE,
550 stderr=subprocess.PIPE,
551 text=True,
552 **env_opts
553 )
555 started = threading.Event()
556 tunnel_started = threading.Event()

File ~\anaconda3\Lib\subprocess.py:1026, in Popen.init(self, args, bufsize, executable, stdin, stdout, stderr, preexec_fn, close_fds, shell, cwd, env, universal_newlines, startupinfo, creationflags, restore_signals, start_new_session, pass_fds, user, group, extra_groups, encoding, errors, text, umask, pipesize, process_group)
1022 if self.text_mode:
1023 self.stderr = io.TextIOWrapper(self.stderr,
1024 encoding=encoding, errors=errors)
→ 1026 self._execute_child(args, executable, preexec_fn, close_fds,
1027 pass_fds, cwd, env,
1028 startupinfo, creationflags, shell,
1029 p2cread, p2cwrite,
1030 c2pread, c2pwrite,
1031 errread, errwrite,
1032 restore_signals,
1033 gid, gids, uid, umask,
1034 start_new_session, process_group)
1035 except:
1036 # Cleanup if the child failed starting.
1037 for f in filter(None, (self.stdin, self.stdout, self.stderr)):

File ~\anaconda3\Lib\subprocess.py:1538, in Popen._execute_child(self, args, executable, preexec_fn, close_fds, pass_fds, cwd, env, startupinfo, creationflags, shell, p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite, unused_restore_signals, unused_gid, unused_gids, unused_uid, unused_umask, unused_start_new_session, unused_process_group)
1536 # Start the process
1537 try:
→ 1538 hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
1539 # no special security
1540 None, None,
1541 int(not close_fds),
1542 creationflags,
1543 env,
1544 cwd,
1545 startupinfo)
1546 finally:
1547 # Child is launched. Close the parent’s copy of those pipe
1548 # handles that only the child should have open. You need
(…)
1551 # pipe will not close when the child process exits and the
1552 # ReadFile will hang.
1553 self._close_pipe_fds(p2cread, p2cwrite,
1554 c2pread, c2pwrite,
1555 errread, errwrite)

FileNotFoundError: [WinError 2] Δεν είναι δυνατή η εύρεση του καθορισμένου αρχείου από το σύστημα

Looks like a file is missing. Not sure what is.

Please, kind restart your kernel and run cell by cell from top to button and share a screenshot.

Thanks