[FLINK-9859][Runtime] Distinguish TM akka config with JM config

What is the purpose of the change
Distinguish TM akka config with JM config.

increase the number of akka threads on JM, to improve its performance
decrease the number of akka threads on TM, to save resource.

Brief change log

AkkaUtils

add a method getTaskExecutorAkkaConfig to distinguish TM's config with JM's
also the config details

TaskManagerRunner && AkkaRpcServiceUtils && AkkaOptions

add a method AkkaRpcServiceUtils#createRpcServiceForTaskExecutor
add a config option AkkaOptions#AKKA_PORT_BIND_TIMEOUT, which defines the timeout of binding retry. This is used in AkkaRpcServiceUtils#createRpcServiceForTaskExecutor
TaskManagerRunner#createRpcService now uses AkkaRpcServiceUtils#createRpcServiceForTaskExecutor to create RpcService

add a test AkkaRpcServiceUtilsTest to see createRpcService works after changes above

Verifying this change
This change added tests and can be verified as follows:

Unit test. Locally create rpc service using customized config, to see whether we could createRpcService properly.

Does this pull request potentially affect one of the following parts:

Dependencies (does it add or upgrade a dependency): (no)
The public API, i.e., is any changed class annotated with @Public(Evolving): (no)
The serializers: (no)
The runtime per-record code paths (performance sensitive): (don't know)
Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Yarn/Mesos, ZooKeeper: (yes)
The S3 file system connector: (no)

Documentation

Does this pull request introduce a new feature? (no, it is internal)

cc @zentol @tzulitai

cc @StephanEwen

cc @tillrohrmann @twalthr

cc @tillrohrmann sure.
rework as configurable(hope I do it in correct way), please review when your are free, thanks!

ping @tillrohrmann

cc @tillrohrmann make fork-join-executor client-socket-work-pool and server-socket-work-pool configurable, should the options be nest like current or flatten?

@tillrohrmann  thanks for your patient review and guide.
The PR goes a bit away from its original purpose so I modify the JIRA message to satisfy the changes.
I am struggling with some monitor config (laugh), that is, I am looking at flink-config stuff. Will take your suggestions on akka config into consideration.
Again, thanks for your patient review and advice.

ping @tillrohrmann  :-)

@tillrohrmann The original purpose of this PR is to distinguish akka config of JM and TM, since JM would require more resource.
Now we enable more akka options, and I wonder if we could still distinguish the config by passing different configure? That is, does JM use the same akka config as that TM uses?

@TisonKun you can provide different configurations to the JM and the TM if you start them individually, for example. However, this does not work when using Yarn or Mesos because there we derive the TM config from the JM config. That would be a different feature which we should properly discuss first.


Creating GCS buckets fails

Hi,
When I am trying to run ./deploy.sh initial_setup I am receiving a few errors.
from file deploy.sh:

This are the changes I made in file deploy.sh :

Any ideas why this occurs?

Remove "<" and ">" from the placeholders

thank you for your fast answer. I made next to your suggestion changes in line 17, because the same massage with errors was occurring from pic above: line 17: bad substitution

This led me to another issue
To have access to gcloud I also needed to install gsutil and configure with following line of code:
gsutil config -w
I found this solution here:
https://cloud.google.com/storage/docs/gsutil/commands/config
best regards


WIP: Issue 899 - Standard Library For different python versions

Hi,
I am currently working on a fix for Issue #899.
My current approach is to get the running python interpreter and then return the correct standard library list based on the version.
I still have a couple of questions:

Is my approach okay?
Is it okay to have the lists in the same file or should I create a new file or maybe save the libraries in a .txt-file?
Where did you get the list of standard libraries because for instance here: https://github.com/timothycrosley/isort/blob/47571635eaa44ee6a110139c771df3bf322e54c3/isort/settings.py#L90

What is aetools or aepack ? I could not find them here: Python3.7 standard library
Best regards! :)
ToDo:

[ ] Adjust Python2 Standard Library List
[ ] Throw exception if different version?

EDIT: I just found out that aetools  is part of the Python2.7 standard library. Could it be that the default_standard_library list needs a polish? If so, I could do that as well. Just let me know if it is okay to just get the standard library from the two links I posted! :)

Hi @Zarathustra2, thanks for working on this! Totally fine to use the running Python as the default, but it should also be possible to override the Python version using a flag (a design goal of isort is to allow having one system installed version, that can be ran across all Python code bases, independent of the Python version they are being developed in)

Hi @timothycrosley!
I have added an option to add a python version as flag. If none is present the python version of the running interpreter will be taken.
Regarding the standard libraries, should I store it in txt files? I think that would give more flexibility for the future and upcoming python versions.
I am not sure why the AppVeyor Pipline failed. It seems like it failed during sending the code coverage results. Could you maybe rerun the pipeline if possible?
Let me know what you think!

Codecov Report

Merging #972 into develop will increase coverage by 0.04%.
The diff coverage is 94.59%.

@@             Coverage Diff             @@
##           develop     #972      +/-   ##
===========================================
+ Coverage    89.69%   89.74%   +0.04%
===========================================
  Files           10       10
  Lines         2631     2663      +32
  Branches       453      457       +4
===========================================
+ Hits          2360     2390      +30
- Misses         184      185       +1
- Partials        87       88       +1

Hi @Zarathustra2, this is looking great!
It's totally fine to add additional stdlib entries to the list, as long as they are from active versions of python (2.7, 3.5+).
I think adding an exception if an unsupported version is passed in is a good idea.
Instead of putting the list in a txt file, you could put the lists in dedicated self-contained Python files (Python files are a little easier to manage from a packaging perspective)
Thinking about it some more, I was wondering if the safest default is to assume a user is writting python2 and 3 compatible code and apply all as stdlib? Then add an auto option to automatically determine it if desired? What do you think?
Great work here!
~Timothy

Hey @timothycrosley,
Thank you for reviewing and your kind words!
I have created the self-contained python files. Is it what you had in mind?
Now also the pipeline fails with the error:  ModuleNotFoundError: No module named 'isort.stdlibs'
Is this my fault? If so could you advice me how to fix it? Sorry, I am not that familiar with CI/CD, just getting started! :)
Regarding the python2 and pyton3 compatible code: Couldn't the user just run
isort --check -py 3 && isort --check -py 2.7? Because I think most people write python3 code without thinking if it runs also in python2.7.
Otherwise if you want me to implement it: Am I right that I just would have to create the intersection of the both libraries-list? Because if I use a standard library which is in python2 and not in python3 and vice versa it would not compile in both, wouldn't it?
Best regards!

Hi @Zarathustra2,
I think the error is occurring simply because an __init__.py file needs to be added at the base of the new stdlibs directory/name-space.

Regarding the python2 and pyton3 compatible code: Couldn't the user just run
isort --check -py 3 && isort --check -py 2.7? Because I think most people write python3 code without thinking if it runs also in python2.7.

Yes they could! However, this would only work if they don't include any stdlib modules that only exist in either2 or 3, if they include one, all the sudden there is no way to modify the code to match both. Hopefully, this makes sense.

Otherwise if you want me to implement it: Am I right that I just would have to create the intersection of the both libraries-list? Because if I use a standard library which is in python2 and not in python3 and vice versa it would not compile in both, wouldn't it?

I think the best, most conservative option, would be a union between the two - that way if the import is likely to be a stdlib import in either, it will show up in the correct section.
Thanks!
~Timothy

Hi @timothycrosley,
All right I will do so!
Adding a init.py did not solve the problem. I noticed only two particular tests fail which is kinda weird. I will try to get travis builds running on my local machine to debug the problem instead of spamming github with commits. If you got any ideas, what is going on, please let me know!
Thanks!
Dario :)

Hey @timothycrosley,
I think the issue is this line:https://github.com/timothycrosley/isort/blob/47571635eaa44ee6a110139c771df3bf322e54c3/test_isort.py#L3231
In both tests that fail because of the import error, this seems to be the cause. I think os.chdir changes the global state but I am not 100% sure why it works locally for me but not on travis.
Maybe sys.path,append() is the solution?
Will investigate it, unfortunately I am kinda busy this weekend & beginning of next week so might take some time but I am still on! :)
Best Regards,
Dario

So what I wrote in my previous post was complete nonsense.
I investigated the tox environments, as seen in the image in the project files overview on the left the stdlibs folder is missing while any newly file created in the existing root folder gets copied/is been recognized. I am not that familiar with tox, actually first time ever working with it, so I would appreciate any input!

Finally found the issue.
In the setup.py I had to update the packages parameter to include also all sub-packages.
Instead of writing both packages down - isort & isort/stdlibs - I used the find_packages() function provided by the setuptools package.

Hi @Zarathustra2, sorry I haven't checked back in on this in a little while. Re looked at your changeset and it looks great to me, however I still see it listed as WIP: are you okay if I merge as is?
Thanks so much for this work! Looking forward to releasing with it!

Hey @timothycrosley Yes this can be merged.
The only thing that I have not done yet and I am unsure what is right/wrong is to adjust the python2 standard library list. Besides adding the user-package I have not added any other packages.
Maybe this should be done in a separate PR since I also noticed that in the python3 standard library list there are some packages listed which do not appear in the python3 standard library list.
If you want, I can do another PR for this! :)
Greetings,
Dario

Hi Dario,
This sounds perfect.
Thank you!


[feature request] Share variables between inputs in input_group

Is it possible to define one of the inputs based on another input when we have multiple inputs in input_group? This requires some way of passing the output of an input in the input_group to the next input. An application of this is when we have two drop down menus for example and the options of the second drop down menu change based on what the user chooses from the first drop down menu. Something like this example:
DBs = ['DB1', 'DB2', 'DB3']
Tables = ['Table1', 'Table2', 'Table3', 'Table4']
text_info = input_group('Database and table name', [
                      select(label='Select the database of the table:', options=DBs, name='DB_name'),
                      select(label='Select the name of the table:', options=Tables, name='Table_name')
                      ])

So is there a way to bind the options of the second drop down menu above to the user selection from the first drop down? Like if the user chooses 'DB1' then the options in the second menu will be 'Table1' and 'Table2' but if the user chooses 'DB2' the options will be 'Table3' and 'Table4'.

PyWebIO does not support this feature currently. I will add it in todo list.
Here is a workaround for now:
DBs = ['DB1', 'DB2']
Tables = {'DB1': ['Table1', 'Table2', ], 'DB2': ['Table3', 'Table4']}
db_name = select(label='Select the database of the table:', options=DBs)
table_name = select(label='Select the name of the table:', options=Tables[db_name])
put_text(table_name)

Thanks for fast response! And for the workaround!

Now you can use the input_update() with the onchange callback to make dependent input.
Doc: https://pywebio.readthedocs.io/en/latest/input.html#pywebio.input.input_update
Demo: http://pywebio-demos.demo.wangweimin.site/doc_demo?app=demo-input-update

@errorcode7 the demo address now is https://pywebio-demos.pywebio.online/doc_demo?app=demo-input-update
Also, the bug you just found was fixed just now, but the demo server have some cache and still don't work

what if there are three select statements inside the input_group , the third one dependent on the value of the first select statement and second one also . Is there any way to share variable between the three select statements  ?
liike i Have a dictionary of dictionaries , the nested dictionaries share keys, so it is not possible to create multiple dictionary. So inorder to obtain the updated values of the third select statement, I need values from first and second. Is it Possible ?


policy: Fix parsing of CIDR labels

labels.maskedIPToLabel() replaces colons in a IPv6 CIDR with dashes due to label name character set limitations. We need to reverse this transformation when parsing a CIDR label to a prefix.
Allow for 0 prefix length CIDR to be properly parsed as well.
Fixes: #22966
IPv6 and IPv4 '<IP_ADDRESS>/0' CIDR parsing in policy processing has been fixed

/test


fix(react-native): bring back check for window.addEventListener

:tada: This PR is included in version 4.0.0-alpha.18 :tada:
The release is available on:

npm package (@alpha dist-tag)
GitHub release

Your semantic-release bot :package::rocket:

:tada: This PR is included in version 4.0.0-beta.1 :tada:
The release is available on:

npm package (@beta dist-tag)
GitHub release

Your semantic-release bot :package::rocket:


Add tests

It would be great if we can have (acceptance) tests for commands in the example Makefile in this repo.
We probably need to provide a dummy python app so commands such as make run actually do something.

Use https://github.com/niteoweb/pyramid-realworld-example-app/blob/master/Makefile instead.


Add min, max, and avg functions

I occasionally come across cases where i need to get the maximum of two variables. Whilst it can be solved by defining an in-Sass function like so:
@function max($a, $b) {
  @return if($a > $b, $a, $b);
}

This solution works, but it's a bit of a pain to define it when I need to use it for each project. It could be included in Compass, ofcourse, but it seems sort-of the wrong place for it.
If max is included, then it would be odd for min not to be included, and it's implementation is similarly trivial.
I can't think of a usecase for avg at the moment, however I think in the broader scope of increasing math-support for SASS it'd be an obvious inclusion.

These functions could also handle lists
min($list) => 4```

I didn't add support for min($list) because presumably it will fall out naturally from #138.
I also didn't add avg() since I doubt it'd be widely useful.

Wonderful, so min and max are sorted, and they care for unit conversion where possible.
I agree with the choice on avg() - I can't see a use for it at the moment.
Anyway, thanks!


Fix snapshot ctr command to use default

After the rework of server-side defaults, the ctr snapshot command
stopped working due to no default snapshotter.
Signed-off-by: Phil Estes<EMAIL_ADDRESS>

Codecov Report

Merging #1411 into master will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master    #1411   +/-   ##
=======================================
  Coverage   40.81%   40.81%
=======================================
  Files          23       23
  Lines        2923     2923
=======================================
  Hits         1193     1193
  Misses       1452     1452
  Partials      278      278

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1046064...4712ed5. Read the comment docs.

LGTM

LGTM


[Q] Create a similar chart to the gradient one

Hi all,
I want to create a chart representing the variation of a distribution over time. Something that is equivalent to the gradient chart of a network when using wandb.watch over that network. Do you have any suggestions on how to do it?

Hi @fmamberti-wandb thank you for your answer. Actually, if I try to use this method, it actually logs nothing, I'm not sure why.
train_metrics["train_metrics/strategy_duration"] =  wandb.Histogram(np.array([value/sum(strategy_duration.values()) for _, value in strategy_duration.items()]))

That's part of the metric that I log, but doing so, there is no chart called "strategy_duration" on wandb

Hi @ColdFrenzy, how are you logging train_metrics["train_metrics/strategy_duration"] ?
for the Histogram to be plotted as shown above, every time a step is logged (so every time you run wandb.log())  you should pass the array with the distribution for one step to wandb.Histogram(), rather than a list of arrays with all the distributions.

Hi @ColdFrenzy , I wanted to follow up on this request. Please let us know if we can be of further assistance or if your issue has been resolved.

Sorry for the super late reply, the problem was described here:
https://github.com/wandb/wandb/issues/1211#issuecomment-993504902
So, the histogram is there, but I was not able to see it from the project page


Model loading speed?

Everything works fine, model can be loaded. But it takes a very long time before it generates something at a decent speed. (2 minutes)
Sometimes it stops after generating 5-10 tokens and after 20 seconds later it proceeds.
Using 13b gpt4 x alpaca, 12gen i7 12700F (n_theads = 20), f16_kv = 1, 16gb ram (fits in)
Using alpaca.cpp it loads in like 2 seconds and generates directly after without stop.

@Naugustogi,
Yes something is wrong with your installation. It is running smoothly on my end.
I think you need to build it from source as you did with alpaca.cpp (you only need cmake).
Please do it and let us know if you face any issues ? Also let us know your setup and what OS are you using ?
Thanks!

@abdeladim-s
i got this gigantic error after using the install,
...
        File "<string>", line 118, in build_extension
        File "C:\Users\Verwender\AppData\Local\Programs\Python\Python310\lib\subprocess.py", line 524, in run
          raise CalledProcessError(retcode, process.args,
      subprocess.CalledProcessError: Command '['cmake', 'C:\\Users\\Verwender\\Desktop\\pyllamacpp\\pyllamacpp\\pyllamacpp', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\\Users\\Verwender\\AppData\\Local\\Temp\\tmp_cdynw8m.build-lib\\', '-DPYTHON_EXECUTABLE=C:\\Users\\Verwender\\Desktop\\pyllamacpp\\pyllamacpp\\pyllamacpp\\env\\Scripts\\python.exe', '-DCMAKE_BUILD_TYPE=Release', '-DEXAMPLE_VERSION_INFO=1.0.7', '-A', 'x64', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\\Users\\Verwender\\AppData\\Local\\Temp\\tmp_cdynw8m.build-lib']' returned non-zero exit status 1.
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building editable for pyllamacpp
Failed to build pyllamacpp
ERROR: Could not build wheels for pyllamacpp, which is required to install pyproject.toml-based projects

then if i would use cmake normally another error appears
-- Building for: NMake Makefiles
CMake Error at CMakeLists.txt:2 (project):
  Running

   'nmake' '-?'

CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!

what i did:
git clone --recursive https://github.com/nomic-ai/pyllamacpp && cd pyllamacpp
pip install .
and then i started the installer.bat

i use windows 11 rtx 3060 ti, 16gb ram, i7, ssd

I updated the Cmakelists hoping it will work on your side.
Please try again now:
git clone --recursive https://github.com/abdeladim-s/pyllamacpp && cd pyllamacpp
pip install .

i use windows 11 rtx 3060 ti, 16gb ram, i7, ssd
I was using the wrapper for a discord bot. I don't want any executables. I think i missed that this are 2 completely different things.

I think you have a very good machine, why not use WSL directly !!? building C++ projects on windows is not that easy.
Yes you can create a wrapper for a discord bot! I don't understand what you mean!

@abdeladim-s

I updated the Cmakelists hoping it will work on your side. Please try again now:
git clone --recursive https://github.com/abdeladim-s/pyllamacpp && cd pyllamacpp
pip install .

C:\Users\Verwender\Desktop\pyllamacpp2>git clone --recursive https://github.com/abdeladim-s/pyllamacpp && cd pyllamacpp
Cloning into 'pyllamacpp'...
remote: Enumerating objects: 650, done.
remote: Counting objects: 100% (650/650), done.
remote: Compressing objects: 100% (450/450), done.
remote: Total 650 (delta 193), reused 623 (delta 179), pack-reused 0
Receiving objects: 100% (650/650), 1.78 MiB | 1.03 MiB/s, done.

Resolving deltas: 100% (193/193), done.
Submodule 'llama.cpp' (https://github.com/ggerganov/llama.cpp.git) registered for path 'llama.cpp'
Cloning into 'C:/Users/Verwender/Desktop/pyllamacpp2/pyllamacpp/llama.cpp'...
remote: Enumerating objects: 2246, done.
remote: Counting objects: 100% (979/979), done.
remote: Compressing objects: 100% (164/164), done.
remote: Total 2246 (delta 892), reused 824 (delta 815), pack-reused 1267
Receiving objects: 100% (2246/2246), 2.20 MiB | 1.36 MiB/s, done.
Resolving deltas: 100% (1452/1452), done.
Submodule path 'llama.cpp': checked out '3525899277d2e2bdc8ec3f0e6e40c47251608700'

C:\Users\Verwender\Desktop\pyllamacpp2\pyllamacpp>pip install .
WARNING: Ignoring invalid distribution -yllamacpp (c:\users\verwender\appdata\local\programs\python\python310\lib\site-packages)
WARNING: Ignoring invalid distribution -yllamacpp (c:\users\verwender\appdata\local\programs\python\python310\lib\site-packages)
Processing c:\users\verwender\desktop\pyllamacpp2\pyllamacpp
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: pyllamacpp
  Building wheel for pyllamacpp (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for pyllamacpp (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [248 lines of output]
      C:\Users\Verwender\AppData\Local\Temp\pip-build-env-3mp60k_f\overlay\Lib\site-packages\setuptools\config\_apply_pyprojecttoml.py:62: _WouldIgnoreField: `description` defined outside of `pyproject.toml` would be ignored.
      !!

              ********************************************************************************
              ##########################################################################
              # configuration would be ignored/result in error due to `pyproject.toml` #

well looks like the same error.
I'm not using WSL because i have no idea about it. I made my bot already with this repo with the pip install pyllamacpp (2.0.0), and the problem was the speed. If i run that normally on an already premade executable its answers instantly (llama.cpp or alpaca.cpp). If i use the webui text generation on gpu its 1Token/s fast. For CPU it takes a while for generating any response such like with this repo (around 60-120 seconds before generating the first word). I have no understanding in that so far. Any Information what it does would be helpful so i can see what i need todo to make it run faster. Or i have to rely on other optimisations in the future.

WSL will make your life easier.
Anyways, Please copy/paste the entire error, so I can see from where it is coming!

WSL will make your life easier.
Anyways, Please copy/paste the entire error, so I can see from where it is coming!

@abdeladim-s here is the full error:
C:\Users\Verwender\Desktop\pyllamacpp2>git clone --recursive https://github.com/abdeladim-s/pyllamacpp && cd pyllamacpp
Cloning into 'pyllamacpp'...
remote: Enumerating objects: 650, done.
remote: Counting objects: 100% (650/650), done.
remote: Compressing objects: 100% (450/450), done.
remote: Total 650 (delta 193), reused 623 (delta 179), pack-reused 0
Receiving objects: 100% (650/650), 1.78 MiB | 1.03 MiB/s, done.

Resolving deltas: 100% (193/193), done.
Submodule 'llama.cpp' (https://github.com/ggerganov/llama.cpp.git) registered for path 'llama.cpp'
Cloning into 'C:/Users/Verwender/Desktop/pyllamacpp2/pyllamacpp/llama.cpp'...
remote: Enumerating objects: 2246, done.
remote: Counting objects: 100% (979/979), done.
remote: Compressing objects: 100% (164/164), done.
remote: Total 2246 (delta 892), reused 824 (delta 815), pack-reused 1267
Receiving objects: 100% (2246/2246), 2.20 MiB | 1.36 MiB/s, done.
Resolving deltas: 100% (1452/1452), done.
Submodule path 'llama.cpp': checked out '3525899277d2e2bdc8ec3f0e6e40c47251608700'

C:\Users\Verwender\Desktop\pyllamacpp2\pyllamacpp>pip install .
WARNING: Ignoring invalid distribution -yllamacpp (c:\users\verwender\appdata\local\programs\python\python310\lib\site-packages)
WARNING: Ignoring invalid distribution -yllamacpp (c:\users\verwender\appdata\local\programs\python\python310\lib\site-packages)
Processing c:\users\verwender\desktop\pyllamacpp2\pyllamacpp
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: pyllamacpp
  Building wheel for pyllamacpp (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for pyllamacpp (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [248 lines of output]
      C:\Users\Verwender\AppData\Local\Temp\pip-build-env-3mp60k_f\overlay\Lib\site-packages\setuptools\config\_apply_pyprojecttoml.py:62: _WouldIgnoreField: `description` defined outside of `pyproject.toml` would be ignored.
      !!

              ********************************************************************************
              ##########################################################################
              # configuration would be ignored/result in error due to `pyproject.toml` #
              ##########################################################################

              The following seems to be defined outside of `pyproject.toml`:

              `description = 'Python bindings for llama.cpp'`

              According to the spec (see the link below), however, setuptools CANNOT
              consider this value unless `description` is listed as `dynamic`.

              https://packaging.python.org/en/latest/specifications/declaring-project-metadata/

              For the time being, `setuptools` will still consider the given value (as a
              **transitional** measure), but please note that future releases of setuptools will
              follow strictly the standard.

              To prevent this warning, you can list `description` under `dynamic` or alternatively
              remove the `[project]` table from your file and rely entirely on other means of
              configuration.

              By 2023-Oct-30, you need to update your project and remove deprecated calls
              or your builds will no longer be supported.
              ********************************************************************************

      !!
        _handle_missing_dynamic(dist, project_table)
      C:\Users\Verwender\AppData\Local\Temp\pip-build-env-3mp60k_f\overlay\Lib\site-packages\setuptools\config\_apply_pyprojecttoml.py:62: _WouldIgnoreField: `requires-python` defined outside of `pyproject.toml` would be ignored.
      !!

              ********************************************************************************
              ##########################################################################
              # configuration would be ignored/result in error due to `pyproject.toml` #
              ##########################################################################

              The following seems to be defined outside of `pyproject.toml`:

              `requires-python = '>=3.8'`

              According to the spec (see the link below), however, setuptools CANNOT
              consider this value unless `requires-python` is listed as `dynamic`.

              https://packaging.python.org/en/latest/specifications/declaring-project-metadata/

              For the time being, `setuptools` will still consider the given value (as a
              **transitional** measure), but please note that future releases of setuptools will
              follow strictly the standard.

              To prevent this warning, you can list `requires-python` under `dynamic` or alternatively
              remove the `[project]` table from your file and rely entirely on other means of
              configuration.

              By 2023-Oct-30, you need to update your project and remove deprecated calls
              or your builds will no longer be supported.
              ********************************************************************************

      !!
        _handle_missing_dynamic(dist, project_table)
      C:\Users\Verwender\AppData\Local\Temp\pip-build-env-3mp60k_f\overlay\Lib\site-packages\setuptools\config\_apply_pyprojecttoml.py:62: _WouldIgnoreField: `license` defined outside of `pyproject.toml` would be ignored.
      !!

              ********************************************************************************
              ##########################################################################
              # configuration would be ignored/result in error due to `pyproject.toml` #
              ##########################################################################

              The following seems to be defined outside of `pyproject.toml`:

              `license = 'MIT'`

              According to the spec (see the link below), however, setuptools CANNOT
              consider this value unless `license` is listed as `dynamic`.

              https://packaging.python.org/en/latest/specifications/declaring-project-metadata/

              For the time being, `setuptools` will still consider the given value (as a
              **transitional** measure), but please note that future releases of setuptools will
              follow strictly the standard.

              To prevent this warning, you can list `license` under `dynamic` or alternatively
              remove the `[project]` table from your file and rely entirely on other means of
              configuration.

              By 2023-Oct-30, you need to update your project and remove deprecated calls
              or your builds will no longer be supported.
              ********************************************************************************

      !!
        _handle_missing_dynamic(dist, project_table)
      C:\Users\Verwender\AppData\Local\Temp\pip-build-env-3mp60k_f\overlay\Lib\site-packages\setuptools\config\_apply_pyprojecttoml.py:62: _WouldIgnoreField: `authors` defined outside of `pyproject.toml` would be ignored.
      !!

              ********************************************************************************
              ##########################################################################
              # configuration would be ignored/result in error due to `pyproject.toml` #
              ##########################################################################

              The following seems to be defined outside of `pyproject.toml`:

              `authors = 'Abdeladim Sadiki'`

              According to the spec (see the link below), however, setuptools CANNOT
              consider this value unless `authors` is listed as `dynamic`.

              https://packaging.python.org/en/latest/specifications/declaring-project-metadata/

              For the time being, `setuptools` will still consider the given value (as a
              **transitional** measure), but please note that future releases of setuptools will
              follow strictly the standard.

              To prevent this warning, you can list `authors` under `dynamic` or alternatively
              remove the `[project]` table from your file and rely entirely on other means of
              configuration.

              By 2023-Oct-30, you need to update your project and remove deprecated calls
              or your builds will no longer be supported.
              ********************************************************************************

      !!
        _handle_missing_dynamic(dist, project_table)
      C:\Users\Verwender\AppData\Local\Temp\pip-build-env-3mp60k_f\overlay\Lib\site-packages\setuptools\config\_apply_pyprojecttoml.py:62: _WouldIgnoreField: `urls` defined outside of `pyproject.toml` would be ignored.
      !!

              ********************************************************************************
              ##########################################################################
              # configuration would be ignored/result in error due to `pyproject.toml` #
              ##########################################################################

              The following seems to be defined outside of `pyproject.toml`:

              `urls = {'Documentation': 'https://abdeladim-s.github.io/pyllamacpp', 'Source': 'https://github.com/abdeladim-s/pyllamacpp', 'Tracker': 'https://github.com/abdeladim-s/pyllamacpp/issues'}`

              According to the spec (see the link below), however, setuptools CANNOT
              consider this value unless `urls` is listed as `dynamic`.

              https://packaging.python.org/en/latest/specifications/declaring-project-metadata/

              For the time being, `setuptools` will still consider the given value (as a
              **transitional** measure), but please note that future releases of setuptools will
              follow strictly the standard.

              To prevent this warning, you can list `urls` under `dynamic` or alternatively
              remove the `[project]` table from your file and rely entirely on other means of
              configuration.

              By 2023-Oct-30, you need to update your project and remove deprecated calls
              or your builds will no longer be supported.
              ********************************************************************************

      !!
        _handle_missing_dynamic(dist, project_table)
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build\lib.win-amd64-cpython-310
      creating build\lib.win-amd64-cpython-310\pyllamacpp
      copying .\pyllamacpp\cli.py -> build\lib.win-amd64-cpython-310\pyllamacpp
      copying .\pyllamacpp\constants.py -> build\lib.win-amd64-cpython-310\pyllamacpp
      copying .\pyllamacpp\model.py -> build\lib.win-amd64-cpython-310\pyllamacpp
      copying .\pyllamacpp\utils.py -> build\lib.win-amd64-cpython-310\pyllamacpp
      copying .\pyllamacpp\webui.py -> build\lib.win-amd64-cpython-310\pyllamacpp
      copying .\pyllamacpp\_logger.py -> build\lib.win-amd64-cpython-310\pyllamacpp
      copying .\pyllamacpp\__init__.py -> build\lib.win-amd64-cpython-310\pyllamacpp
      running egg_info
      writing pyllamacpp.egg-info\PKG-INFO
      writing dependency_links to pyllamacpp.egg-info\dependency_links.txt
      writing entry points to pyllamacpp.egg-info\entry_points.txt
      writing top-level names to pyllamacpp.egg-info\top_level.txt
      reading manifest file 'pyllamacpp.egg-info\SOURCES.txt'
      reading manifest template 'MANIFEST.in'
      adding license file 'LICENSE'
      writing manifest file 'pyllamacpp.egg-info\SOURCES.txt'
      running build_ext
      -- Building for: NMake Makefiles
      CMake Error at CMakeLists.txt:8 (project):
        Generator

          NMake Makefiles

        does not support platform specification, but platform

          x64

        was specified.

      CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
      CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
      -- Configuring incomplete, errors occurred!
      Traceback (most recent call last):
        File "C:\Users\Verwender\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 363, in <module>
          main()
        File "C:\Users\Verwender\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 345, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "C:\Users\Verwender\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 261, in build_wheel
          return _build_backend().build_wheel(wheel_directory, config_settings,
        File "C:\Users\Verwender\AppData\Local\Temp\pip-build-env-3mp60k_f\overlay\Lib\site-packages\setuptools\build_meta.py", line 416, in build_wheel
          return self._build_with_temp_dir(['bdist_wheel'], '.whl',
        File "C:\Users\Verwender\AppData\Local\Temp\pip-build-env-3mp60k_f\overlay\Lib\site-packages\setuptools\build_meta.py", line 401, in _build_with_temp_dir
          self.run_setup()
        File "C:\Users\Verwender\AppData\Local\Temp\pip-build-env-3mp60k_f\overlay\Lib\site-packages\setuptools\build_meta.py", line 338, in run_setup
          exec(code, locals())
        File "<string>", line 132, in <module>
        File "C:\Users\Verwender\AppData\Local\Temp\pip-build-env-3mp60k_f\overlay\Lib\site-packages\setuptools\__init__.py", line 107, in setup
          return distutils.core.setup(**attrs)
        File "C:\Users\Verwender\AppData\Local\Temp\pip-build-env-3mp60k_f\overlay\Lib\site-packages\setuptools\_distutils\core.py", line 185, in setup
          return run_commands(dist)
        File "C:\Users\Verwender\AppData\Local\Temp\pip-build-env-3mp60k_f\overlay\Lib\site-packages\setuptools\_distutils\core.py", line 201, in run_commands
          dist.run_commands()
        File "C:\Users\Verwender\AppData\Local\Temp\pip-build-env-3mp60k_f\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 969, in run_commands
          self.run_command(cmd)
        File "C:\Users\Verwender\AppData\Local\Temp\pip-build-env-3mp60k_f\overlay\Lib\site-packages\setuptools\dist.py", line 1244, in run_command
          super().run_command(command)
        File "C:\Users\Verwender\AppData\Local\Temp\pip-build-env-3mp60k_f\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
          cmd_obj.run()
        File "C:\Users\Verwender\AppData\Local\Temp\pip-build-env-3mp60k_f\overlay\Lib\site-packages\wheel\bdist_wheel.py", line 343, in run
          self.run_command("build")
        File "C:\Users\Verwender\AppData\Local\Temp\pip-build-env-3mp60k_f\overlay\Lib\site-packages\setuptools\_distutils\cmd.py", line 318, in run_command
          self.distribution.run_command(command)
        File "C:\Users\Verwender\AppData\Local\Temp\pip-build-env-3mp60k_f\overlay\Lib\site-packages\setuptools\dist.py", line 1244, in run_command
          super().run_command(command)
        File "C:\Users\Verwender\AppData\Local\Temp\pip-build-env-3mp60k_f\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
          cmd_obj.run()
        File "C:\Users\Verwender\AppData\Local\Temp\pip-build-env-3mp60k_f\overlay\Lib\site-packages\setuptools\_distutils\command\build.py", line 131, in run
          self.run_command(cmd_name)
        File "C:\Users\Verwender\AppData\Local\Temp\pip-build-env-3mp60k_f\overlay\Lib\site-packages\setuptools\_distutils\cmd.py", line 318, in run_command
          self.distribution.run_command(command)
        File "C:\Users\Verwender\AppData\Local\Temp\pip-build-env-3mp60k_f\overlay\Lib\site-packages\setuptools\dist.py", line 1244, in run_command
          super().run_command(command)
        File "C:\Users\Verwender\AppData\Local\Temp\pip-build-env-3mp60k_f\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
          cmd_obj.run()
        File "C:\Users\Verwender\AppData\Local\Temp\pip-build-env-3mp60k_f\overlay\Lib\site-packages\setuptools\command\build_ext.py", line 84, in run
          _build_ext.run(self)
        File "C:\Users\Verwender\AppData\Local\Temp\pip-build-env-3mp60k_f\overlay\Lib\site-packages\setuptools\_distutils\command\build_ext.py", line 345, in run
          self.build_extensions()
        File "C:\Users\Verwender\AppData\Local\Temp\pip-build-env-3mp60k_f\overlay\Lib\site-packages\setuptools\_distutils\command\build_ext.py", line 467, in build_extensions
          self._build_extensions_serial()
        File "C:\Users\Verwender\AppData\Local\Temp\pip-build-env-3mp60k_f\overlay\Lib\site-packages\setuptools\_distutils\command\build_ext.py", line 493, in _build_extensions_serial
          self.build_extension(ext)
        File "<string>", line 118, in build_extension
        File "C:\Users\Verwender\AppData\Local\Programs\Python\Python310\lib\subprocess.py", line 524, in run
          raise CalledProcessError(retcode, process.args,
      subprocess.CalledProcessError: Command '['cmake', 'C:\\Users\\Verwender\\Desktop\\pyllamacpp2\\pyllamacpp', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\\Users\\Verwender\\Desktop\\pyllamacpp2\\pyllamacpp\\build\\lib.win-amd64-cpython-310\\', '-DPYTHON_EXECUTABLE=C:\\Users\\Verwender\\AppData\\Local\\Programs\\Python\\Python310\\python.exe', '-DCMAKE_BUILD_TYPE=Release', '-DEXAMPLE_VERSION_INFO=2.0.0', '-A', 'x64', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\\Users\\Verwender\\Desktop\\pyllamacpp2\\pyllamacpp\\build\\lib.win-amd64-cpython-310']' returned non-zero exit status 1.
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for pyllamacpp
Failed to build pyllamacpp
ERROR: Could not build wheels for pyllamacpp, which is required to install pyproject.toml-based projects
WARNING: Ignoring invalid distribution -yllamacpp (c:\users\verwender\appdata\local\programs\python\python310\lib\site-packages)
WARNING: Ignoring invalid distribution -yllamacpp (c:\users\verwender\appdata\local\programs\python\python310\lib\site-packages)
WARNING: Ignoring invalid distribution -yllamacpp (c:\users\verwender\appdata\local\programs\python\python310\lib\site-packages)

[notice] A new release of pip available: 22.2.1 -> 23.1.2
[notice] To update, run: python.exe -m pip install --upgrade pip

alright i'm looking into WSL.

I think you do not have cmake in the PATH variable or it is not installed. Are you sure you built alpaca.cpp yourself ?
You need to install Visual Studio C++ and Cmake first, before building.
Please run this to check if you have it:
cmake --version

I think you do not have cmake in the PATH variable or it is not installed. Are you sure you built alpaca.cpp yourself ?
You need to install Visual Studio C++ and Cmake first, before building. Please run this to check if you have it:
cmake --version

I never builded any of them myself, i simply use pre compiled versions. I'm not going to install VS c++ for using it 1 times. I simply don't have and want to use my bandwith with it.
I can try to reinstall cmake with path.
cmake is version 3.26.3
I installed WSL.
Also the basic problem wasn't that i wanted to compile any of these, you can check my gpt4xalpaca code for using the wrapper.
https://github.com/Naugustogi/gpt4-x-Alpaca-Discord-bot/blob/main/alpacaxgpt4.py
Nothing interesting, but in use its very slow. That was the main problem why i made this issue. Not compiling it myself. Note that i don't know where the wrapper takes the llama.cpp into account.

Yeah, I understand ..
Sometimes things does not go as expected (especially in IT), so one needs to be patient and learn along the way.
You see, when you do pip install, pip is just pulling a prebuilt wheel from Pypi website, the prebuilt wheels are built with a standard virtual machine (llama.cpp is the source code used to build that wheel),
So maybe it is running slow because it is not the right prebuilt wheel for your machine, that's why I told you to build it, I hope you get it now!
If you installed WSL, try the package first as usual (from pip install) and then try to build if it is still slow, I think cmake will probably be already installed.

Yeah, I understand .. Sometimes things does not go as expected (especially in IT), so one needs to be patient and learn along the way.
You see, when you do pip install, pip is just pulling a prebuilt wheel from Pypi website, the prebuilt wheels are built with a standard virtual machine (llama.cpp is the source code used to build that wheel), So maybe it is running slow because it is not the right prebuilt wheel for your machine, that's why I told you to build it, I hope you get it now!
If you installed WSL, try the package first as usual (from pip install) and then try to build if it is still slow, I think cmake will probably be already installed.

so i did run it with wsl, the only difference is that it doesn't stop using my cpu. So it guess its a small amount faster?
pip install . or cmake . (path is installed) both fail with the same compiling error, is there really no way around VS c++? Which of these should i install at all? I get that with the wheel now.

Well which one should i choose?

Only faster by a small amount, that's weird!
try to build on WSL as well ? not windows!
pip install .

Only faster by a small amount, that's weird!
try to build on WSL as well ? not windows! pip install .

C:\Users\Verwender\Desktop\pyllamacpp2\pyllamacpp>wsl
pip install .root@User:/mnt/c/Users/Verwender/Desktop/pyllamacpp2/pyllamacpp# pip install .
Processing /mnt/c/Users/Verwender/Desktop/pyllamacpp2/pyllamacpp
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: pyllamacpp
Building wheel for pyllamacpp (pyproject.toml) ... error
error: subprocess-exited-with-error
× Building wheel for pyllamacpp (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [5 lines of output]
running bdist_wheel
running build
running build_py
running build_ext
error: [Errno 2] No such file or directory: 'cmake'
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for pyllamacpp
Failed to build pyllamacpp
ERROR: Could not build wheels for pyllamacpp, which is required to install pyproject.toml-based projects
root@User:/mnt/c/Users/Verwender/Desktop/pyllamacpp2/pyllamacpp#
Already tryed that too with WSL

Only faster by a small amount, that's weird!
try to build on WSL as well ? not windows! pip install .

C:\Users\Verwender\Desktop\pyllamacpp2\pyllamacpp>wsl pip install .root@User:/mnt/c/Users/Verwender/Desktop/pyllamacpp2/pyllamacpp# pip install . Processing /mnt/c/Users/Verwender/Desktop/pyllamacpp2/pyllamacpp Installing build dependencies ... done Getting requirements to build wheel ... done Preparing metadata (pyproject.toml) ... done Building wheels for collected packages: pyllamacpp Building wheel for pyllamacpp (pyproject.toml) ... error error: subprocess-exited-with-error
× Building wheel for pyllamacpp (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> [5 lines of output] running bdist_wheel running build running build_py running build_ext error: [Errno 2] No such file or directory: 'cmake' [end of output]
note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for pyllamacpp Failed to build pyllamacpp ERROR: Could not build wheels for pyllamacpp, which is required to install pyproject.toml-based projects root@User:/mnt/c/Users/Verwender/Desktop/pyllamacpp2/pyllamacpp#
Already tryed that too with WSL

pip3 install cmake

Only faster by a small amount, that's weird!
try to build on WSL as well ? not windows! pip install .

C:\Users\Verwender\Desktop\pyllamacpp2\pyllamacpp>wsl pip install .root@User:/mnt/c/Users/Verwender/Desktop/pyllamacpp2/pyllamacpp# pip install . Processing /mnt/c/Users/Verwender/Desktop/pyllamacpp2/pyllamacpp Installing build dependencies ... done Getting requirements to build wheel ... done Preparing metadata (pyproject.toml) ... done Building wheels for collected packages: pyllamacpp Building wheel for pyllamacpp (pyproject.toml) ... error error: subprocess-exited-with-error
× Building wheel for pyllamacpp (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> [5 lines of output] running bdist_wheel running build running build_py running build_ext error: [Errno 2] No such file or directory: 'cmake' [end of output]
note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for pyllamacpp Failed to build pyllamacpp ERROR: Could not build wheels for pyllamacpp, which is required to install pyproject.toml-based projects root@User:/mnt/c/Users/Verwender/Desktop/pyllamacpp2/pyllamacpp#
Already tryed that too with WSL

pip install cmake

root@User:/mnt/c/Users/Verwender/Desktop/pyllamacpp2/pyllamacpp# pip3 install cmake
Collecting cmake
Using cached cmake-3.26.3-py2.py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (24.0 MB)
Installing collected packages: cmake
Successfully installed cmake-3.26.3
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
root@User:/mnt/c/Users/Verwender/Desktop/pyllamacpp2/pyllamacpp# pip install .
Processing /mnt/c/Users/Verwender/Desktop/pyllamacpp2/pyllamacpp
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: pyllamacpp
Building wheel for pyllamacpp (pyproject.toml) ... error
error: subprocess-exited-with-error
× Building wheel for pyllamacpp (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [55 lines of output]
running bdist_wheel
running build
running build_py
running build_ext
CMake Error: The current CMakeCache.txt directory /mnt/c/Users/Verwender/Desktop/pyllamacpp2/pyllamacpp/CMakeCache.txt is different than the directory c:/Users/Verwender/Desktop/pyllamacpp2/pyllamacpp where CMakeCache.txt was created. This may result in binaries being created in the wrong place. If you are not sure, reedit the CMakeCache.txt
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/pip/_vendor/pep517/in_process/_in_process.py", line 363, in
main()
File "/usr/lib/python3/dist-packages/pip/_vendor/pep517/in_process/_in_process.py", line 345, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "/usr/lib/python3/dist-packages/pip/_vendor/pep517/in_process/_in_process.py", line 261, in build_wheel
return _build_backend().build_wheel(wheel_directory, config_settings,
File "/usr/lib/python3/dist-packages/setuptools/build_meta.py", line 230, in build_wheel
return self._build_with_temp_dir(['bdist_wheel'], '.whl',
File "/usr/lib/python3/dist-packages/setuptools/build_meta.py", line 215, in _build_with_temp_dir
self.run_setup()
File "/usr/lib/python3/dist-packages/setuptools/build_meta.py", line 158, in run_setup
exec(compile(code, file, 'exec'), locals())
File "setup.py", line 132, in
setup(
File "/usr/lib/python3/dist-packages/setuptools/init.py", line 153, in setup
return distutils.core.setup(**attrs)
File "/usr/lib/python3/dist-packages/setuptools/_distutils/core.py", line 148, in setup
return run_commands(dist)
File "/usr/lib/python3/dist-packages/setuptools/_distutils/core.py", line 163, in run_commands
dist.run_commands()
File "/usr/lib/python3/dist-packages/setuptools/_distutils/dist.py", line 967, in run_commands
self.run_command(cmd)
File "/usr/lib/python3/dist-packages/setuptools/_distutils/dist.py", line 986, in run_command
cmd_obj.run()
File "/usr/lib/python3/dist-packages/wheel/bdist_wheel.py", line 299, in run
self.run_command('build')
File "/usr/lib/python3/dist-packages/setuptools/_distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/usr/lib/python3/dist-packages/setuptools/_distutils/dist.py", line 986, in run_command
cmd_obj.run()
File "/usr/lib/python3/dist-packages/setuptools/_distutils/command/build.py", line 135, in run
self.run_command(cmd_name)
File "/usr/lib/python3/dist-packages/setuptools/_distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/usr/lib/python3/dist-packages/setuptools/_distutils/dist.py", line 986, in run_command
cmd_obj.run()
File "/usr/lib/python3/dist-packages/setuptools/command/build_ext.py", line 79, in run
_build_ext.run(self)
File "/usr/lib/python3/dist-packages/setuptools/_distutils/command/build_ext.py", line 339, in run
self.build_extensions()
File "/usr/lib/python3/dist-packages/setuptools/_distutils/command/build_ext.py", line 448, in build_extensions
self._build_extensions_serial()
File "/usr/lib/python3/dist-packages/setuptools/_distutils/command/build_ext.py", line 473, in _build_extensions_serial
self.build_extension(ext)
File "setup.py", line 118, in build_extension
subprocess.run(
File "/usr/lib/python3.10/subprocess.py", line 524, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['cmake', '/mnt/c/Users/Verwender/Desktop/pyllamacpp2/pyllamacpp', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/mnt/c/Users/Verwender/Desktop/pyllamacpp2/pyllamacpp/build/lib.linux-x86_64-3.10/', '-DPYTHON_EXECUTABLE=/usr/bin/python3', '-DCMAKE_BUILD_TYPE=Release', '-DEXAMPLE_VERSION_INFO=2.0.0', '-GNinja', '-DCMAKE_MAKE_PROGRAM:FILEPATH=/tmp/pip-build-env-cxutpyp6/overlay/local/lib/python3.10/dist-packages/ninja/data/bin/ninja']' returned non-zero exit status 1.
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for pyllamacpp
Failed to build pyllamacpp
ERROR: Could not build wheels for pyllamacpp, which is required to install pyproject.toml-based projects
root@User:/mnt/c/Users/Verwender/Desktop/pyllamacpp2/pyllamacpp#
my mistake, but i still get this result

try this instead:
pip install git+https://github.com/abdeladim-s/pyllamacpp.git

try this instead:
pip install git+https://github.com/abdeladim-s/pyllamacpp.git

That's way faster, i don't know what changed still (~40 seconds)

Copy/Paste the result of this:
from _pyllamacpp import llama_print_system_info
print(llama_print_system_info())

C:\Users\Verwender>python
Python 3.10.6 (tags/v3.10.6:9c7b4bd, Aug  1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.

from _pyllamacpp import llama_print_system_info
print(llama_print_system_info())
AVX = 1 | AVX2 = 1 | AVX512 = 0 | FMA = 1 | NEON = 0 | ARM_FMA = 0 | F16C = 1 | FP16_VA = 0 | WASM_SIMD = 0 | BLAS = 0 | SSE3 = 1 | VSX = 0 |

I think everything is good now. same as mine.
If you want to run one more check:
from pyllamacpp.model import Model

def new_text_callback(text: str):
    print(text, end="", flush=True)

llama_config = { "n_ctx": 2048}
model = Model(ggml_model=model_path,  **llama_config)
question = "Can you tell me, how did the Dutch obtain Manhattan, and what did it cost?\n"
model._generate(question, new_text_callback=new_text_callback,)

and copy/paste the results ?

llama_model_load: loading model from 'gpt4-x-alpaca-13b-native-ggml-model-q4_0.bin' - please wait ...
llama_model_load: n_vocab = 32001
llama_model_load: n_ctx   = 2048
llama_model_load: n_embd  = 5120
llama_model_load: n_mult  = 256
llama_model_load: n_head  = 40
llama_model_load: n_layer = 40
llama_model_load: n_rot   = 128
llama_model_load: f16     = 2
llama_model_load: n_ff    = 13824
llama_model_load: n_parts = 2
llama_model_load: type    = 2
llama_model_load: ggml map size = 7759.84 MB
llama_model_load: ggml ctx size = 101.25 KB
llama_model_load: mem required  = 9807.93 MB (+ 3216.00 MB per state)
llama_model_load: loading tensors from 'gpt4-x-alpaca-13b-native-ggml-model-q4_0.bin'
llama_model_load: model size =  7759.40 MB / num tensors = 363
llama_init_from_file: kv self size  = 3200.00 MB
llama_generate: seed =<PHONE_NUMBER>
system_info: n_threads = 20 / 20 | AVX = 1 | AVX2 = 1 | AVX512 = 0 | FMA = 1 | NEON = 0 | ARM_FMA = 0 | F16C = 1 | FP16_VA = 0 | WASM_SIMD = 0 | BLAS = 0 | SSE3 = 1 | VSX = 0 |
sampling: temp = 0.800000, top_k = 40, top_p = 0.950000, repeat_last_n = 64, repeat_penalty = 1.100000
generate: n_ctx = 2048, n_batch = 8, n_predict = 128, n_keep = 0
Can you tell me, how did the Dutch obtain Manhattan, and what did it cost?
släktet комаров с добавлением новых фотографий и видеороликов. [end of text]
llama_print_timings:        load time = 12879.61 ms
llama_print_timings:      sample time =    19.32 ms /    22 runs   (    0.88 ms per run)
llama_print_timings: prompt eval time = 16656.92 ms /    21 tokens (  793.19 ms per token)
llama_print_timings:        eval time =  5862.53 ms /    21 runs   (  279.17 ms per run)
llama_print_timings:       total time = 24045.04 ms
ok now i don't see the speed problem anymore, had to modify to use all my cores not just 4

yes, that was my second recommendation.
But now it is really fast.
Congrats :slightly_smiling_face:

Thanks for your help, the more context it has, is it like n² of time?

You can close this issue, it finally works!

Thanks for your help, the more context it has, is it like n² of time?

welcome.
Yes. well not exactly n**2 but it takes time to digest the context. especially if it is long.

Hi @abdeladim-s , i wondered if the llama cpp updated, we just run again pip install git+ ... ?
And do you know if using it in python have overhead compared to directly using llama cpp?
With llama cpp now can use prompt caching, is it supported? And if there's new parameters added in llama cpp, it will automatically ready?
Sorry for lots of questions

Hi @x4080,

Sorry, I didn't understand your first question!
Yeah, there should be some overhead from the Python interpreter, however all the computation is still done on the cpp side, so I think the overhead is not noticeable.
if prompt caching was just added this month, then probably not supported yet, I am planning to sync the project soon.
If a new parameter is added, it won't be automatically ready, I'll need to create bindings for it.

Let me know if you have any other questions.

Thanks @abdeladim-s
my first question refers to installation
pip install git+https://github.com/abdeladim-s/pyllamacpp.git

So I'll wait for your implementation then, maybe I'll asked again in discussion (if I need some help)
Cheers

yeah, if you want to install from source then use that command, otherwise you can pull the prebuilt binaries from PYPI
pip install pyllamacpp

Sure, feel free to ask if you need any help :)


(WIP) ape example

For others' context, here is the related paper: https://openreview.net/forum?id=YdqwNaCLCx&referrer=[Program Chair Console](%2Fgroup%3Fid%3DNeurIPS.cc%2F2022%2FWorkshop%2FFMDM%2FProgram_Chairs%23paper-status).

stale


Problem in editing a user-defined function

I am trying to edit the function nw_algorithm in https://numbas.mathcentre.ac.uk/question/9377/minimum-cost-algorithm/
In particular to change the while statement to something like while(ct<=9).
However, if I attempt to edit this, everything freezes , chrome snaps and IE sometimes tells me that there is a long-running script interfering.

This is caused by an infinite loop. Javascript doesn't let me watch functions and stop them if they take too long.
I suppose you could turn off automatic regeneration of variables while editing the function, since they only get evaluated when used in a variable definition.

Can I close this?

Yes
Sent from my iPhone
On 2 Sep 2015, at 15:59, Christian Perfect <notifications<EMAIL_ADDRESS>wrote:
Can I close this?

Reply to this email directly or view it on GitHubhttps://github.com/numbas/editor/issues/267#issuecomment-137114102.


Issue/736 also enable batched partial compiles for termination states (#7717)

Pull request opened by the merge tool on behalf of #7717

Merged into branches iso7 in 1a4a2a910c643dc35feab4b49e65d7536db4488e


Check invalid cut operations

cut(v, w) should be ignored if there's no edge (v, w).

connected(v, w) already fixes this issue.


Bug: SALE_TOGGLE webhook payload may exceed size limits.

What are you trying to achieve?
Current logic sends all product variant global IDs in SALE_TOGGLE webhook payload. Our infra allows to pass 256KB. So sending over 10k of variant IDs breaks Celery task handle_promotion_toggle. However, narrowing the payload would result in breaking compatibility.
Steps to reproduce the problem
Unable to reproduce locally.
What did you expect to happen?
Celery task do not stuck for huge number of product variants covered by promotion.
Logs
No response
Environment
Saleor version: …
OS and version: …

Internal discussion: https://saleorcommerce.slack.com/archives/C04NWC09NE8/p1701442444522199


[Bug]: numeric input config doesn't report out-of-bound default values as error

Is there an existing issue for this?

[X] I have searched the existing issues

Description
when default value for numeric input is lower/higher than min/max value, the widget is highlighted (red border) but no errors are reported. in deployed websites, the input is always invalid

Steps To Reproduce

add numeric input
set min, max values
set default value lower/higher than min/max value
check bottom error panel & widget error tooltip

Public Sample App
No response
Version
cloud

Closing this because the error will be shown on focus as is the UX for all inputs


DOCS: Add help menu in example

This help menu is composed of three buttons:

About dedicated to inform the user on the package (version, use, dependency);
Online documentation redirect the user to online documentation;
Issue tracker redirect the user to the issues of the project.

Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 100.00%. Comparing base (69a1988) to head (5d80802).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #134   +/-   ##
=========================================
  Coverage   100.00%   100.00%
=========================================
  Files            8         8
  Lines          595       595
=========================================
  Hits           595       595

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.


chore(CategoryTheory/Limits/Shapes/BinaryProducts): don't use tactics to construct data

bors merge


Bug Template: Improve structure and guidance for issue reporting

Overview
This PR improves the bug report template to help users provide more complete and structured information when reporting issues.
Changes

Reorganized template with clear section headers
Added dedicated sections for environment details and extension checks
Separated expected and actual behavior sections
Added specific guidance for different types of bugs (UI, console errors, code issues)
Improved instructions for providing system information
Added section for reproducible demos

Benefits

Reduces back-and-forth communication in issue discussions
Makes it easier for maintainers to triage issues
Helps users provide necessary information upfront
Improves the quality of bug reports

Testing
The template has been tested by:

Verifying markdown formatting renders correctly
Ensuring all comment blocks are properly formatted
Checking that section headers are consistent
Validating that guidance text is clear and actionable

Screenshots

Before
After

[Previous template layout]
[New template layout]

Related Documentation

Issue reporting guidelines
Contributing guidelines

Wybierz mi grę, daj mi szczęście, może wygram.
-------- Oryginalny adres e-mail -------
Z: rik3k @.>
Wysłano: 10 listopada 2024 01:34:47 CET
Do: microsoft/vscode @.>
DW: Subscribed @.***>
Temat: [microsoft/vscode] Bug Template: Improve structure and guidance for issue reporting (PR #233506)
Overview
This PR improves the bug report template to help users provide more complete and structured information when reporting issues.
Changes

Reorganized template with clear section headers
Added dedicated sections for environment details and extension checks
Separated expected and actual behavior sections
Added specific guidance for different types of bugs (UI, console errors, code issues)
Improved instructions for providing system information
Added section for reproducible demos

Benefits

Reduces back-and-forth communication in issue discussions
Makes it easier for maintainers to triage issues
Helps users provide necessary information upfront
Improves the quality of bug reports

Testing
The template has been tested by:

Verifying markdown formatting renders correctly
Ensuring all comment blocks are properly formatted
Checking that section headers are consistent
Validating that guidance text is clear and actionable

Screenshots

Before
After

[Previous template layout]
[New template layout]

Related Documentation

Issue reporting guidelines

Contributing guidelines
You can view, comment on, or merge this pull request online at:
https://github.com/microsoft/vscode/pull/233506

-- Commit Summary --

Improve bug report template structure and clarity

-- File Changes --
M .github/ISSUE_TEMPLATE/bug_report.md (43)

-- Patch Links --
https://github.com/microsoft/vscode/pull/233506.patch
https://github.com/microsoft/vscode/pull/233506.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/microsoft/vscode/pull/233506
You are receiving this because you are subscribed to this thread.
Message ID: @.***>


Getting error while trying to replicate

I was able to successfully load the model and dataset. However, when the training initiates, I get an error "self and mat2 must have the same dtype". Could you please help?

me too


[Sign up] The background image of Popup is different.

Environment: Windows 10 Home, Version 80.0 (64-bit)
Reproducible: always
Build found: "commit 147fa44"
Steps to reproduce

Go to 'https://ita-social-projects.github.io/GreenCityClient/#/welcome.'
Click on 'Sign-up button'

Actual result
Missing items of the background image

Expected result
The background image has to be the same as in the mockup

User story and test case links
E.g.: "User story #385
[Test case]https://jira.softserve.academy/browse/GC-216
Labels to be added
"Bug", Priority ("pri: medium"), Severity ("severity: trivial"), Type ("UI").

Not fixed


IntelliSense does not work when changed SearchPath in PythonSettings.json file in open folder.

Environment

Steps to Reproduce

Open folder in SE.
Add new python file in SE named module1.py
Select an python environment from the python toolbar to open PythonSettings.json and you can check “Show All Files” on the toolbar to reveal local settings.
Create a folder named folder1 in your local ,such like : C:\Project\Temp\searchpath\folder1
Add init.py in folder1 and type some code in init.py

def FOLDER1_MSG():
    print("hello world!")

Add searchpaths in PythonSettings.json

Type code below in WholsRunningMe.py

import folder1
folder1.FOLDER1_MSG()

IntelliSense should show squiggles on the import statement
Change using the correct environment is to import a module that doesn’t exist in one of your environments
a. Change SearchPaths

you should see the squiggles in WholsRunningMe.py

Change to correct SearchPaths to make sure the squiggles go away

Expected behavior
The squiggles about the import folder1 should change as the SearchPath changes.
Actual result
The squiggles did not appear when change to incorrect SearchPaths.

My guess is that we

have a bug updating the language server settings
this is another file that isn't watched by pylance.
Not sure which.

Whats the project root folder? C:\Project\Temp\searchpath? I think pylance only watches under root

This issue also can preproduce on today's environment

On this environment, when changed the SearchPath, not see the squiggles in WholsRunningMe.py

In today's build 17.6.0 Preview 1.0 [33319.311.main] ,Python Package: 17.0.23005.2, The correct searchpath does not have folder1 intellisense that related to https://github.com/microsoft/PTVS/issues/6974. "IntelliSense does not work when changed SearchPath in PythonSettings.json file in open folder." This cannot repro every time, and we will continue to track this issue.


DBZ-8351 Fix TestInfrastructureHelper

closes: https://issues.redhat.com/browse/DBZ-8531

@mfvitale Applied, thanks for the fast turnaround! Could you please handle the server issue in a separate PR?


C2 - Project init sets wrong keys in git dict

When setting up a new project for cumulusci 2.0 using the "project init" command, some git variables are set for the wrong keys, which show up in the cumulusci.yml. They should be changed like so:
branch --> default_branch
beta --> prefix_beta
release --> prefix_release

this was fixed in 1cfa23


test.py

Thanks for providing open source code, can you provide test.py ?

@stonessss yes, i write test code.

copy and overwrite.
https://github.com/jaemin93/pytorch-deeplab-xception/blob/master/test.py
https://github.com/jaemin93/pytorch-deeplab-xception/blob/master/dataloaders/__init__.py

add test.txt(you want to test img id) in VOC path /ImageSets/Segmentation
test.txt is like val, train.txt

cmd
python --test \  --dataset pascal \  --backbone xception \  --out_stride 16 \  --crop_size 513 \  --model /your/checkpoint.pth.tar  --save_path /prediction/iamge/path

@stonessss yes, i write test code.

copy and overwrite.
https://github.com/jaemin93/pytorch-deeplab-xception/blob/master/test.py
https://github.com/jaemin93/pytorch-deeplab-xception/blob/master/dataloaders/__init__.py
add test.txt(you want to test img id) in VOC path /ImageSets/Segmentation
test.txt is like val, train.txt
cmd
'
python --test
--dataset pascal
--backbone xception
--out_stride 16
--crop_size 513
--model /your/checkpoint.pth.tar
--save_path /prediction/image/path
'
python --test\ --dataset pascal \ --backbone xception \ --out_stride 16 \ --crop_size 513 \ --model /your/checkpoint.pth.tar \ --save_path /prediction/image/path

I'm missing pascal.py so I'll add it.
https://github.com/jaemin93/pytorch-deeplab-xception/blob/009b7d583d8cbc763d9ce6127973d03f96a7e5c9/dataloaders/datasets/pascal.py#L80

Thank you very much！I found an open source code to test a single image.
And you can do this run it :

python test.py --in-path test_image --out-path output_image

`import argparse
import os
import numpy as np
from modeling.deeplab import *
from dataloaders import custom_transforms as tr
from PIL import Image
from torchvision import transforms
from dataloaders.utils import  *
from torchvision.utils import make_grid, save_image
def main():
parser = argparse.ArgumentParser(description="PyTorch DeeplabV3Plus Training")
parser.add_argument('--in-path', type=str, required=True, help='image to test')
parser.add_argument('--out-path', type=str, required=True, help='mask image to save')
parser.add_argument('--backbone', type=str, default='resnet',
choices=['resnet', 'xception', 'drn', 'mobilenet'],
help='backbone name (default: resnet)')
parser.add_argument('--ckpt', type=str, default='deeplab-resnet.pth',
help='saved model')
parser.add_argument('--out-stride', type=int, default=16,
help='network output stride (default: 8)')
parser.add_argument('--no-cuda', action='store_true', default=True,
help='disables CUDA training')
parser.add_argument('--gpu-ids', type=str, default='0',
help='use which gpu to train, must be a
comma-separated list of integers only (default=0)')
parser.add_argument('--dataset', type=str, default='pascal',
choices=['pascal', 'coco', 'cityscapes'],
help='dataset name (default: pascal)')
parser.add_argument('--crop-size', type=int, default=513,
help='crop image size')
parser.add_argument('--sync-bn', type=bool, default=None,
help='whether to use sync bn (default: auto)')
parser.add_argument('--freeze-bn', type=bool, default=False,
help='whether to freeze bn parameters (default: False)')
args = parser.parse_args()
args.cuda = not args.no_cuda and torch.cuda.is_available()
if args.cuda:
    try:
        args.gpu_ids = [int(s) for s in args.gpu_ids.split(',')]
    except ValueError:
        raise ValueError('Argument --gpu_ids must be a comma-separated list of integers only')

if args.sync_bn is None:
    if args.cuda and len(args.gpu_ids) > 1:
        args.sync_bn = True
    else:
        args.sync_bn = False

model = DeepLab(num_classes=21,
                backbone=args.backbone,
                output_stride=args.out_stride,
                sync_bn=args.sync_bn,
                freeze_bn=args.freeze_bn)

ckpt = torch.load(args.ckpt, map_location='cpu')
model.load_state_dict(ckpt['state_dict'])

composed_transforms = transforms.Compose([
    tr.Normalize(mean=(0.485, 0.456, 0.406), std=(0.229, 0.224, 0.225)),
    tr.ToTensor()])

image = Image.open(args.in_path).convert('RGB')
target = Image.open(args.in_path).convert('L')
sample = {'image': image, 'label': target}
tensor_in = composed_transforms(sample)['image'].unsqueeze(0)

model.eval()
if args.cuda:
    image = image.cuda()
with torch.no_grad():
    output = model(tensor_in)

grid_image = make_grid(decode_seg_map_sequence(torch.max(output[:3], 1)[1].detach().cpu().numpy()),
                        3, normalize=False, range=(0, 255))
print("type(grid) is: ", type(grid_image))
print("grid_image.shape is: ", grid_image.shape)
save_image(grid_image, args.out_path)

if name == "main":
main()`

Thank you very much！I found an open source code to test a single image.
And you can do this run it :
python test.py --in-path test_image --out-path output_image
`import argparse
import os
import numpy as np
from modeling.deeplab import *
from dataloaders import custom_transforms as tr
from PIL import Image
from torchvision import transforms
from dataloaders.utils import  *
from torchvision.utils import make_grid, save_image
def main():
parser = argparse.ArgumentParser(description="PyTorch DeeplabV3Plus Training")
parser.add_argument('--in-path', type=str, required=True, help='image to test')
parser.add_argument('--out-path', type=str, required=True, help='mask image to save')
parser.add_argument('--backbone', type=str, default='resnet',
choices=['resnet', 'xception', 'drn', 'mobilenet'],
help='backbone name (default: resnet)')
parser.add_argument('--ckpt', type=str, default='deeplab-resnet.pth',
help='saved model')
parser.add_argument('--out-stride', type=int, default=16,
help='network output stride (default: 8)')
parser.add_argument('--no-cuda', action='store_true', default=True,
help='disables CUDA training')
parser.add_argument('--gpu-ids', type=str, default='0',
help='use which gpu to train, must be a
comma-separated list of integers only (default=0)')
parser.add_argument('--dataset', type=str, default='pascal',
choices=['pascal', 'coco', 'cityscapes'],
help='dataset name (default: pascal)')
parser.add_argument('--crop-size', type=int, default=513,
help='crop image size')
parser.add_argument('--sync-bn', type=bool, default=None,
help='whether to use sync bn (default: auto)')
parser.add_argument('--freeze-bn', type=bool, default=False,
help='whether to freeze bn parameters (default: False)')
args = parser.parse_args()
args.cuda = not args.no_cuda and torch.cuda.is_available()
if args.cuda:
    try:
        args.gpu_ids = [int(s) for s in args.gpu_ids.split(',')]
    except ValueError:
        raise ValueError('Argument --gpu_ids must be a comma-separated list of integers only')

if args.sync_bn is None:
    if args.cuda and len(args.gpu_ids) > 1:
        args.sync_bn = True
    else:
        args.sync_bn = False

model = DeepLab(num_classes=21,
                backbone=args.backbone,
                output_stride=args.out_stride,
                sync_bn=args.sync_bn,
                freeze_bn=args.freeze_bn)

ckpt = torch.load(args.ckpt, map_location='cpu')
model.load_state_dict(ckpt['state_dict'])

composed_transforms = transforms.Compose([
    tr.Normalize(mean=(0.485, 0.456, 0.406), std=(0.229, 0.224, 0.225)),
    tr.ToTensor()])

image = Image.open(args.in_path).convert('RGB')
target = Image.open(args.in_path).convert('L')
sample = {'image': image, 'label': target}
tensor_in = composed_transforms(sample)['image'].unsqueeze(0)

model.eval()
if args.cuda:
    image = image.cuda()
with torch.no_grad():
    output = model(tensor_in)

grid_image = make_grid(decode_seg_map_sequence(torch.max(output[:3], 1)[1].detach().cpu().numpy()),
                        3, normalize=False, range=(0, 255))
print("type(grid) is: ", type(grid_image))
print("grid_image.shape is: ", grid_image.shape)
save_image(grid_image, args.out_path)

if name == "main":
main()`

Thank you very much, I found an open source code to test a single image.

@stonessss I can test a lot of data so see if needed. :)

There are some problems in the code, error in pascal.py.

tell me what error.

Thank you for your sharing.
Error 1: NUM_CLASSES = 21;
Error 2: The label image should be in .jpg format（There was no error in the previous version.）
And I thinkl “assert” can remove.

I didn't have that problem. Can you copy your error and show it to me?

I think a bit misunderstanding, the error occurred in the link code you shared, I don't understand why it is different from the original code, the system may not be updated in time. There is no problem in the original code,  I have solved these problems.Anyway thank you very much !

okay, I'm glad to solve the problem.

Have you set up random cropping in the test set? Where？

how can i use test.py to test sityscapes?
since i change pascal to sicyscapes,an error has occurred
AttributeError: 'Namespace' object has no attribute 'batch_size'

@mm86443
Since I changed the repo template, I'll help you if you can see your code.

@mm86443
Since I changed the repo template, I'll help you if i can see your code.

thank you,i reslove this problem last night.
i remake the code in dataloader.init.py , so i can run your 'test.py' successful.
    elif args.dataset == 'cityscapes' and args.test:         test_set =  cityscapes.CityscapesSegmentation(args, split='test')         num_class = test_set.NUM_CLASSES         test_loader = DataLoader(test_set, batch_size=1, shuffle=False)         ids = test_set.files['test']         return test_loader, ids, num_class
thanks for you provide your code again.

@mm86443
Since I changed the repo template, I'll help you if i can see your code.

hello, your test.py link is not available now?Could you share it again?Thank you so much .

why the above link has 404 not found error? Please give a test.py file again, thanks!! @jaemin93

@yang8595 @huidemie I'm sorry keep your waiting. test.py is renamed inference.py

@jaemin93 Hello, thanks for sharing. I am a beginner, I would like to ask where is the model generated after training with my own data set? And what other areas do you need to modify besides using your inference.py file? I use xception.

@brx290
0. if you can find experiment_{0, 1, ...} folder, there is checkpoint file (*.pth.tar).

Then, you define deeplabv3 model (backbone xception) and load checkpoint file.
Just give the data as my inference.py data flows.

@jaemin93
Thank you for your answer. I found my checkpoint file. Can you explain in detail how do I define the deeplabv3 model (backbone xception) and load the checkpoint file. Do I need to copy all your files to my folder?

@brx290
No, you don't have to. you make inference.py
# define
model = DeepLab(num_classes=self.nclass,
                        backbone=args.backbone,
                        output_stride=args.out_stride,
                        sync_bn=False,
                        freeze_bn=False)

# load
checkpoint = torch.load('your/pth.tar/file', map_location='cpu')
model.load_state_dict(checkpoint['state_dict'])

# prepare inference
model.eval()
test_img = Image.open('test.png').convert('RGB')
test_array = np.array(test_img).astype(np.float32)

# Normalize
test_array /= 255.0
test_array -= (0.485, 0.456, 0.406)
test_array /= (0.229, 0.224, 0.225)
test_tensor = torch.from_numpy(test_array)

# inference
with torch.no_grad():
    # you can get prediction
    output = model(test_tensor)

the code is not perfect. but I hope it helps.

@jaemin93
Thank you for your help. I have run successfully. Is the generated picture a mask picture? The following is the result of my operation.

@brx290
you need to map the predicted values to RGB values.
[[0, 0, 0],
[0, 1, 0],
[0, 1, 1]]
There is no difference between 0 and 1 in human view in grayscale values.

@jaemin93
Thank you for your guidance, I can already get the split picture. There is still a problem that bothers me. How to draw a loss curve. I found summaries.py in the utils file and I don't know how to use it.

@brx290
That's because the file(summaries.py) imports the tensorboardX package.
It would be helpful to refer to this. https://pytorch.org/docs/stable/tensorboard.html
It's simple and you'll understand right away. Then I hope you enjoy coding :)

@brx290
you need to map the predicted values to RGB values.
[[0, 0, 0],
[0, 1, 0],
[0, 1, 1]]
There is no difference between 0 and 1 in human view in grayscale values.

I have the same question，but i do not know how to modify it specifically.Can you tell me the details.Thank you so much!

Thank you for your inference.py code! I set --backbone resnet --dataset pascal --epoch 100 to train process, and get miou 77%.However when i test the images, I get the results like this.i dont know where is the problem.

Looking forward to your reply!

@mm86443
Since I changed the repo template, I'll help you if i can see your code.

thank you,i reslove this problem last night.
i remake the code in dataloader.init.py , so i can run your 'test.py' successful.
 elif args.dataset == 'cityscapes' and args.test: test_set = cityscapes.CityscapesSegmentation(args, split='test') num_class = test_set.NUM_CLASSES test_loader = DataLoader(test_set, batch_size=1, shuffle=False) ids = test_set.files['test'] return test_loader, ids, num_class
thanks for you provide your code again.

hello，can you show me your test.py?

Test.py is renamed inference.py
보낸 사람: zhujiesuper<EMAIL_ADDRESS>회신 대상: jfzhang95/pytorch-deeplab-xception<EMAIL_ADDRESS>날짜: 2020년 4월 29일 수요일 오후 2:22
받는 사람: jfzhang95/pytorch-deeplab-xception<EMAIL_ADDRESS>참조: Jaemin jung<EMAIL_ADDRESS>Mention<EMAIL_ADDRESS>주제: Re: [jfzhang95/pytorch-deeplab-xception] test.py (#122)
@mm86443https://github.com/mm86443
Since I changed the repo template, I'll help you if i can see your code.
thank you,i reslove this problem last night.
i remake the code in dataloader.init.py , so i can run your 'test.py' successful.
elif args.dataset == 'cityscapes' and args.test: test_set = cityscapes.CityscapesSegmentation(args, split='test') num_class = test_set.NUM_CLASSES test_loader = DataLoader(test_set, batch_size=1, shuffle=False) ids = test_set.files['test'] return test_loader, ids, num_class
thanks for you provide your code again.
hello，can you show me your test.py?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHubhttps://github.com/jfzhang95/pytorch-deeplab-xception/issues/122#issuecomment-620994189, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AHDTHJOWAK7AFNU3LCMHGJTRO62RHANCNFSM4I65PEIQ.

Test.py is renamed inference.py 보낸 사람: zhujiesuper<EMAIL_ADDRESS>회신 대상: jfzhang95/pytorch-deeplab-xception<EMAIL_ADDRESS>날짜: 2020년 4월 29일 수요일 오후 2:22 받는 사람: jfzhang95/pytorch-deeplab-xception<EMAIL_ADDRESS>참조: Jaemin jung<EMAIL_ADDRESS>Mention<EMAIL_ADDRESS>주제: Re: [jfzhang95/pytorch-deeplab-xception] test.py (#122) @mm86443https://github.com/mm86443 Since I changed the repo template, I'll help you if i can see your code. thank you,i reslove this problem last night. i remake the code in dataloader.init.py , so i can run your 'test.py' successful. elif args.dataset == 'cityscapes' and args.test: test_set = cityscapes.CityscapesSegmentation(args, split='test') num_class = test_set.NUM_CLASSES test_loader = DataLoader(test_set, batch_size=1, shuffle=False) ids = test_set.files['test'] return test_loader, ids, num_class thanks for you provide your code again. hello，can you show me your test.py? — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub<#122 (comment)>, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AHDTHJOWAK7AFNU3LCMHGJTRO62RHANCNFSM4I65PEIQ.

thank you,but i can not use this inference.py directly,im

@mm86443
Since I changed the repo template, I'll help you if i can see your code.

thank you,i reslove this problem last night.
i remake the code in dataloader.init.py , so i can run your 'test.py' successful.
 elif args.dataset == 'cityscapes' and args.test: test_set = cityscapes.CityscapesSegmentation(args, split='test') num_class = test_set.NUM_CLASSES test_loader = DataLoader(test_set, batch_size=1, shuffle=False) ids = test_set.files['test'] return test_loader, ids, num_class
thanks for you provide your code again.

hello ,i  can not use test.py or inference.py? can you show me your code?

Test.py重命名为inference.py。意图：zhujiesuper<EMAIL_ADDRESS>/ pytorch-deeplab-xception<EMAIL_ADDRESS>22岁的照片：jfzhang95 / pytorch-deeplab-xception<EMAIL_ADDRESS>jung icebanana93<EMAIL_ADDRESS>[jfzhang95 / pytorch-deeplab-xception] test.py（＃122） @ mm86443 < https://github.com/mm86443>由于我更改了回购模板，因此如果能看到您的代码，我会为您提供帮助。谢谢，我昨晚喜欢这个问题。我在dataloader.init.py中重新制作了代码，因此我可以成功运行您的'test.py'。elif args.dataset =='cityscapes'和args.test：test_set =城市景观.CityscapesSegmentation（args，split ='test'）num_class = test_set.NUM_CLASSES test_loader = DataLoader（test_set，batch_size = 1，shuffle = False）ids = test_set .files ['test']返回test_loader，id，num_class谢谢您再次提供代码。你好，你能告诉我你的test.py吗？—您收到此邮件是因为被提及。直接回复此电子邮件，在GitHub < ＃122（评论） >上查看，或取消订阅< https://github.com。

Hello, when I ran the "inference. py" file, I was prompted that I did not have the "config.json" file. Could you please provide the "config.json" file

Test.py is renamed inference.py 보낸 사람: zhujiesuper<EMAIL_ADDRESS>회신 대상: jfzhang95/pytorch-deeplab-xception<EMAIL_ADDRESS>날짜: 2020년 4월 29일 수요일 오후 2:22 받는 사람: jfzhang95/pytorch-deeplab-xception<EMAIL_ADDRESS>참조: Jaemin jung<EMAIL_ADDRESS>Mention<EMAIL_ADDRESS>주제: Re: [jfzhang95/pytorch-deeplab-xception] test.py (#122) @mm86443https://github.com/mm86443 Since I changed the repo template, I'll help you if i can see your code. thank you,i reslove this problem last night. i remake the code in dataloader.init.py , so i can run your 'test.py' successful. elif args.dataset == 'cityscapes' and args.test: test_set = cityscapes.CityscapesSegmentation(args, split='test') num_class = test_set.NUM_CLASSES test_loader = DataLoader(test_set, batch_size=1, shuffle=False) ids = test_set.files['test'] return test_loader, ids, num_class thanks for you provide your code again. hello，can you show me your test.py? — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub<#122 (comment)>, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AHDTHJOWAK7AFNU3LCMHGJTRO62RHANCNFSM4I65PEIQ.

hello! I have some problems.why no checkpoint found at 'model_best.pth' in  inference.py.But I have modified the path in config.json

Test.py被重命名inference.py 보 낸 사 람 ：zhujiesuper<EMAIL_ADDRESS>회 신 대 상 ：jfzhang95 / pytorch-deeplab-xception<EMAIL_ADDRESS>날 짜 ：2020 년 4 월 29 일 수 요 일 오 후 2:22 받 는 사 람 ： jfzhang95 / pytorch-deeplab-xception<EMAIL_ADDRESS>참조：Jaemin jung<EMAIL_ADDRESS>noreply.github.com주제：回复：[jfzhang95 / pytorch-deeplab-xception]测试.py（＃122）@ mm86443 https://github.com/mm86443由于我更改了回购模板，因此如果我能看到您的代码，就会为您提供帮助。谢谢，我昨晚喜欢这个问题。我在dataloader.init.py中重新编写了代码，因此我可以成功运行您的'test.py'。elif args.dataset =='cityscapes'和args.test：test_set =城市景观.CityscapesSegmentation（args，split ='test'）num_class = test_set.NUM_CLASSES test_loader = DataLoader（test_set，batch_size = 1，shuffle = False）ids = test_set .files ['test']返回test_loader，id，num_class，感谢您再次提供代码。你好，你能告诉我你的test.py吗？—您收到此邮件是因为有人提到您。直接回复此电子邮件，在GitHub < ＃122（评论） >上查看，或退订https：// github。

你好！我有一些问题。为什么在inference.py的'model_best.pth'上找不到检查点，但是我修改了config.json中的路径

May i ask you where is "config.json."? could you provide the  file？

@stonessss yes, i write test code.

copy and overwrite.
https://github.com/jaemin93/pytorch-deeplab-xception/blob/master/test.py
https://github.com/jaemin93/pytorch-deeplab-xception/blob/master/dataloaders/__init__.py
add test.txt(you want to test img id) in VOC path /ImageSets/Segmentation
test.txt is like val, train.txt
cmd
python --test
--dataset pascal
--backbone xception
--out_stride 16
--crop_size 513
--model /your/checkpoint.pth.tar
--save_path /prediction/image/path

Hello! The links you provided are invalid. Could you please provide again? Thank you very much!


Column.display_name and filter form

When one declares a Column like so:
class MyTable(Table):
  foo = Column(display_name='bar', filter__include=True, ...)

Then the label used for filter field will be foo (similar for the field name in the advanced search).  I would argue it should be bar.
Failing that I would argue that the documentation for display_name should mention how to adjust those names.
A good scenario to keep in mind might be someone who writes his code in English but is trying to write a small business website/app that doesn't need full blown localisation (aka the website doesn't need to be translated into several languages), but should display every label / helptext and error message in forms in a language that isn't English.

Well, it works if "bar" has no spaces, but if it's "Foo bar" then we have a problem in the query language. So we'd have to at least convert it to "foo_bar" then for the advanced filtering. But given that I might agree...
But you can also do
bar = Column(attr='foo')

At least in the declarative style.. in the auto style there is no way to override the name I believe. What about this @jlubcke ?

Concerning:
bar = Column(attr='foo')
That is a little sad if you are writing your program in English, but your labels are e.g. German.  For what it is worth with my limited experience so far I consider the auto style to be primarily a prototyping tool, and are not that sad if in that style I can't overwrite the name.  Well If I wanted to be difficult I could say that one of iommi's selling points is the ease by which one can override behaviour in a minimal way.  So maybe this indicates that the query system isn't yet fully fulfilling its potential wrt the iommi way ;-)
That all said at least my experience with https://django-tables2.readthedocs.io/en/latest/ quickly let me to believe that eventually I will declare all columns anyway.  So all magic aside, more important seems to me that one should be able to specify explicitely different names for each of the following concepts:

the name in the source
the display_name of the Column
the display_name of the Field in the simple query
the field name in the query language

We (or at least I) do want the auto feature to be more than a prototyping tool, even if it might not be ready for all cases just yet.
Hm.. thinking about this more I believe that iommi should:

read the verbose_name from your model and it should use that for display_name by default in the auto mode
use display_name.replace(' ', '_') as the user facing name in the advanced search language as you said
support that verbose_name on your model (and display_name when given explicitly) can be a LazyText instance for translation.

Does this seem reasonable to you?

Yes that sounds pretty good.

But in the end I fear one should still support explicit overrides.  So that the user facing name in the  advanced search language can be different from the labels of the column or field -- even if it is only to make it easy to include other information in the column or field label.  E.g.
speed = Column(attr='engine__speed', filter__query_name='Geschwindigkeit', display_name='Geschwindigkeit (km/h)')

100% agree.

After a discussion with Johan our plan for translated query language is:
The advanced language can be localized by us doing a simple replace when rendering it. We also write what language was to write the query in the URL. This means that if you send a German URL to your French friend we can see that the URL you got used a German advanced query so we can translate that to the internal English, and then render it out as French. If you then click "filter" again the friend will now get a URL with French names for stuff and the URL will contain a language identifier so we can do the same translation back to you when the friend sends their URL back.
I hope that made sense :P

Oh yea, and the plan is for sorting and simple filter request parameters to use the internal name still. So while you'd search for bilmodell=ford in the advanced search, the URL would be ....?car_model=ford. Would this be ok from a translation point of view for you? We think ideally users aren't really interacting with the URL so it doesn't need to be translated.

Agreed

Some notes from me to me on implementation:
>>> from django.utils.translation.trans_real import translation
>>> translation('sv')
<DjangoTranslation lang:sv>
>>> t = translation('sv')
>>> t.
t.BE_MAGIC             t.charset(             t.install(             t.merge(               t.set_output_charset(
t.LE_MAGIC             t.domain               t.language(            t.ngettext(            t.to_language(
t.VERSIONS             t.gettext(             t.lgettext(            t.output_charset(
t.add_fallback(        t.info(                t.lngettext(           t.plural(
>>> t._catalog
<django.utils.translation.trans_real.TranslationCatalog object at 0x1044942d0>
>>> t._catalog.
t._catalog.get(     t._catalog.items(   t._catalog.keys(    t._catalog.plural(  t._catalog.update(
>>> t._catalog.items()
<generator object TranslationCatalog.items at 0x104528450>
>>> list(t._catalog.keys())

Adding query_name as suggested above in #137