Spaces:
Runtime error
Runtime error
Commit ·
34c16bd
1
Parent(s): a284f57
cuda bug
Browse files15 unmodified lines16171819202122232442 unmodified lines67686970717273747515 unmodified linesclass RetrievalApp:def get_device_options(self):if torch.cuda.is_available:return ["cuda", "cpu"]else:return ["cpu"]42 unmodified linesst.table(get_repos_with_descriptions(retrieval_pipe.X_df, task_repos))with st.spinner(text="fetching results"):st.write(retrieval_pipe.search(query, k, description_length, additional_shown_cols).to_html(escape=False, index=False),unsafe_allow_html=True,)print("finished retrieval")15 unmodified lines161718192021222324252627282930313242 unmodified lines75767778798081828315 unmodified linesclass RetrievalApp:def is_cuda_available(self):try:t = torch.Tensor([1]).cuda()except:return Falsefinally:return Truedef get_device_options(self):if self.is_cuda_available():return ["cpu", "cuda"]else:return ["cpu"]42 unmodified linesst.table(get_repos_with_descriptions(retrieval_pipe.X_df, task_repos))with st.spinner(text="fetching results"):st.write(retrieval_pipe.search(query, k, description_length, additional_shown_cols).to_html(escape=False, index=False),unsafe_allow_html=True,)print("finished retrieval")
app_implementation.py+13-5