machineuser commited on
Commit
beb51b0
·
1 Parent(s): e3e396b

Sync widgets demo

Browse files
packages/tasks/src/library-ui-elements.ts CHANGED
@@ -1,6 +1,8 @@
1
  import type { ModelData } from "./model-data";
2
  import type { ModelLibraryKey } from "./model-libraries";
3
 
 
 
4
  /**
5
  * Elements configurable by a model library.
6
  */
@@ -422,7 +424,7 @@ const transformers = (model: ModelData) => {
422
  if (!info) {
423
  return [`# ⚠️ Type of model unknown`];
424
  }
425
- const remote_code_snippet = info.custom_class ? ", trust_remote_code=True" : "";
426
 
427
  let autoSnippet: string;
428
  if (info.processor) {
 
1
  import type { ModelData } from "./model-data";
2
  import type { ModelLibraryKey } from "./model-libraries";
3
 
4
+ const TAG_CUSTOM_CODE = "custom_code";
5
+
6
  /**
7
  * Elements configurable by a model library.
8
  */
 
424
  if (!info) {
425
  return [`# ⚠️ Type of model unknown`];
426
  }
427
+ const remote_code_snippet = model.tags?.includes(TAG_CUSTOM_CODE) ? ", trust_remote_code=True" : "";
428
 
429
  let autoSnippet: string;
430
  if (info.processor) {